The lick shown here will fit in pretty much any harmonic situation (click on it to enlarge it). You can work it as you please, then resolve it on a chord tone and move on.
I like to start it on the flat five of a dominant chord, particularly an altered dominant or a V7b9. The first measure here, for instance, could pair with an F#7b9, and the next measure with an E7b9, and so on, moving downward by whole step with each measure and resolving finally to an F# major chord in the last bar.
You could just as easily maintain an F#7 throughout the entire lick. It will work fine, with dissonances justifying themselves as either leading or passing tones.
The lick also works well with a minor chord, though instead of starting on the flat five, you might try starting on the fourth or fifth. Really, just experiment and decide what you like.
The nice thing about a lick like this is that you can use just fragments of it–a single bar is nice–or you can coast on it for a bit till your brain finds a jump-off point, then launch into a new creative direction.
Have fun with this little device. And if you enjoyed this post, be sure to check out my many other articles on jazz theory, exercises, and solo transcriptions.