Just the same way as when you compose melodies over chords normally.. if you got a C chord you'll use C,E and G mainly for the melody xP sometimes using some passing notes inbetween or adding a 7th etc..

If the instrumental is riff based, then it might be a little more tricky... But usually if the riff's base lays on the key root note for example (say it's an Am.. for example) then usually notes in that chord would work.. A,C,E sometimes G(7th) ..its better to explain it in practice but I hope I helped in some way? :P