Start with a 'hook'. This is a simple but memorable melody that goes with the chords. Revolve your improvisation around this riff, deviating through:
- Articulation: use hammer-ons, pull-offs, bends, double-stops, slides, etc.
- Passing notes: play one or two notes to close any gaps between notes of the main riff.
- Fills: guitarists sometimes play short fills when the vocals are not singing. Similarly, use short riffs to fill up the gaps in the 'hook'. You can use riffs you've practiced from other songs as fills, so its important to expand your musical vocabulary.
- Changing the 'hook': simplest way is to just play it one octave up to bring it to a climax. Otherwise, you can substitute fills into the riff. Listeners expect to hear the riff, but these fills bring them away from the 'baseline'. There's a sense of resolvement when you return to the main riff agian.