I don't think the instrument or the style of music really matters that much. Essentially, you're creating a melody, and if you approach your solo as such, the only thing to consider is whether or not it suits the song.
It has to suit the song stylistically... a Randy Rhodes solo probably wouldn't work that well in, say, Wish You Were Here by Floyd. This is the easy part....
The more difficult part is that it has to suit the song tonally. This is where a good knowledge of scales and modes comes in REALLY handy, though not absolutely essential if you have a good ear. If your song is, say, in G major, you may very well want to use the notes in
a G major scale, ensuring that the notes you use "work" over the chords that they go against. (insert big long lesson of harmony/counterpoint here....) For purposes of "flavouring" though, you might elect to use a G blues scale, or a dorian mode, which is sort of like a blues scale crossed with a regular major scale. A phyrgian scale will give your melody a sort of "spanish" feel to it (Metallica uses this a fair bit... listen to Wherever I May Roam)
As a very general summary here, let's say stick to the notes that appear in the chords that you're using, but don't be afraid to experiment with notes that dont.... notes that break the "rules" can give a lot of character - they can also sound like crap. Your ear has to be the judge. If you think of it as building an alternate melody though, you'll be fine.
Chris