I just want to second Jim's comment about being familiar with the kind of music you are playing--in some music, you can be really out there (meaning playing notes and rhythmic phrases that create a lot of tension against the original chords and melody) and in other music, you cannot--A fairly common trick in jazz is to play the same melodic phrase over each of the chords in a progression to get a variety of harmonies--this could get you killed if you tried it with tradtional music--
For those of you who are curious about this effect, try playing the bass notes or chords to Frere Jaques in C, and play the melody in a couple of other keys, like D, or G, and end up trying it in F#(easy on piano, but slightly more diverting on guitar)