Watch the Strategy 8: Sing Your Lines online guitar lesson by Jon Herington from Ear IQ: Soloing Strategies
Another strategy I really recommend is to try singing your solo before playing it. Sometimes the best way to get your ear working is to stop your hands from playing first. Step away from the guitar! It can force you to listen in a pure way to what a track might need, and it can directly tap into a deeper source of your own music making creativity.
All too often players get in the habit of playing what I call "hands first", instead of "head first", or maybe better yet, "heart first". After all that expression "play by heart" is all about playing music that's become a part of you, that's internalized. Of course, all players with experience accumulate a kind of muscle memory, and their hands can sometimes save them when inspiration fails. But there are a lot of circumstances where an attempt to sing some pure, appropriate musical idea can lead you to new things that you wouldn't typically play on the guitar, and that's a great thing!