scales? Or at least that's what I've gathered from what i've been reading. You need to at least know the pentatonic scales very well. Knowing the notes of the fretboard will also be a very big help.
Scales...major and minor to start with. Learn what notes sound good together and what dont. Move on to modes and technical stuff like alternate picking and whammy bar usage......that stuff.
I would listen to scales on the net and find a few that catch your ear..
you can start by listening to those..

Listen to your favorite guitarists and study their music...

When i had trouble writing solos...on day i realised that a solo
can be looked at as your compilation of a bunch of licks..

(If that ticked you off..it wasnt meant to be offensive to you
hardcore theorists)
I bet Charlie Brown's teacher's name was Mrs.Hammett
If you're looking to play fast, you'll want to brush up on simple exercises, scales, modes, alternate picking and economy picking. After you pick up on the simple exercises move to the awkwardly complex, and then work with moving your scales up and down the neck in several positions. See how starting and ending at different points in the scale effects the sound. That's if you want to play fast...

If you want to play with feel (Not saying fast-solo's have no feeling!), then I would suggest learning one or two scales and writing a very simple chord progression. Using the scale that you learned, experiment with what notes sound good when put together using the techniques you already know (Hammer-ons, pull-offs, slides, vibratos, bends, tapping etc). If you don't already know those techniques... well then there's where you should start

Once you can play fast and with feeling, start doing sweeping, legato runs, whammy-bar-fanciness, and so on. When learning to solo you need to build upon everything you know, and take in everything that you hear.
Quote by ragingbear
What should i learn to get better at soloing?
Learn the major scale. Say your soloing over a C-F-G chord progression then you could solo in C major make sure to hit the intervals included in the chords you are playing over. Throw in some bends, slides, vibrato, and legato and bam your soloing. Just learn how the major scale works and how chords relate to it so you know how to solo over any progression.