Hmmm, good Q. I'm assuming that you already know some scales/modes - stuff like that. Without those, you'll never get anywhere. But with only those, you'll also get to a point, known as NO WHERE.
They get you going. That's all. And you don't really need all of them or as many as you think you need.
There are three very important things once you've got some scales/modes down and these are -
1) FEEL
2) Tell a Story (the only reasons you want a solo is to tell a story or to give a vibe that isn't there in the song. And this feel/vibe thingy is awesome/cool/whoopie/wow/YIKES/cool/HMmmmm/hmmmm/DANG/dangIT etc.
3) DON"T PLAY OTHER PEOPLE"S LICKS!!!!!!!!!!!!!!!!!! If you have a story to tell, and you should, because otherwise, why do a solo??? And your story is your story and your story is told using your notes, aka your licks. Be good (that means practice, play and listen to yourself). Being yourself is better (that means more practice, more playing and more listening) . But being better than yourself is always best! (and that means just be yourself and put your heart into it. If your heart isn't into doing a solo then don't do it. Having said that, a good guitarist should, more often than not, be able to find a good solo. There are exceptions and once you're good enough you'll know when to let go, meaning, not to have a solo. Again, a solo is there only to lend a hand to the song. The song rules. All the time. Your solo is only there to enhance the song, nothing less and nothing more, just there trying to communicate with your listeners, to tell your story. Be it as it may be that you're a guitarist, a drummer, a keyboardist etc etc etc.
A song is written to communicate something(s). Anything less isn't a song and anything more becomes, well ..., a BIG song. "-)
I should have just come out from Rehab. BUT they wouldn't let me in~!~! DUH! So take all that i say with a couple of inches of RoRK salt.
Anyways, have a listen to my non-rehab stuff here. I think I speaketh the truth.
http://www.broadcastgems.com/rork_music/
Peace and God Bless. And your tone. Urgh, your tone is in your FINGERS! If you can't sound decent with an acoustic, while soloing: URGH!!! Then you should practice more.
K. Nuff said. Time for me to go watch some football.