What I do when I compose (that is if I'm not composing out of my head) is I jam over the track... for a few hours.... and even then I only come up with certain spots here and there that I want to keep. It's a trial and error thing. I take solos as the music's lyrics. It's the chance for the music to really say something and if you rush it then the song's voice isn't heard over all that frantic stuff. When jamming I just keep playing and when I hear something click like a certain bend timed right with a crash or a slight tap on the whammy bar then I think "hey that worked, now to branch outward from that and make the rest mesh" it's a very stable structure and should be handled with care. Too many good solos are lost because the composer settled. John Petrucci put it best. "the song comes first".
The Gods Made Heavy Metal, And They Saw That It Was Good
They Said To Play It Louder Than Hell, We Promised That We Would
Hulk Smash!!
Whatever you do, don't eat limes. A friend of mine ate a lime once and BAM!! Two years later. Herpes.