Once you have your chord progression set out, the next part is to lay an accompanying melody on top of it.
Your chord pattern will be in a certain key, and each step (chord) will help establish where the melody is going.
The most common method of doing things is by playing chord tones. Say, for instance, your progression is in D and you play the fifth degree of the scale as a chord which is A. The tones which make up the fifth degree are 5, 7 and 2 (see below) – so any of those degrees in the D scale will fit nicely over the fifth chord (the A).
These chord tones are listed in D but are applicable to all keys:
I (D): 1, 3, 5
II (E): 2, 4, 6
III (F#): 3, 5, 7
IV (G): 4, 6, 1
V (A): 5, 7, 2
VI (B): 6, 1, 3
VII (C#): 7, 2, 4