One night at our weekly jam session, a new guy showed up and played some guitar with us. It's always interesting watching players you're not familiar with, because everyone has different ways of approaching things, and different ways of feeling the song.
So there I was, watching this guy take his solos, and the first thing that struck me was that his solos always sounded great. As I watched longer, I began to realize he didn't even do a whole lot of really complex stuff that you might expect in a great guitar solo. No, instead he favored simpler guitar licks that followed the melody of the song, and just well, sounded great.
It was a good reminder that sometimes we can get too caught up in the latest greatest lick or guitar trick, and end up forgetting the melody.
I find that one way to practice staying "clued in" to the melody is to use jam tracks - as opposed to simply playing by yourself without any backing.
When you're playing guitar by yourself, you lack the context in which to play a solo... and although you can get a lot of benefit out of this type of practicing (scales, finger dexterity, new licks, etc) you're always going to lack that connection to the music that comes from practicing with jam tracks.
So make sure you practice with some context - preferably with a jam track that inspires you to new musical heights.
You can find a great collection of jam tracks here: 30 Blues Jam Tracks.