The best way to learn to construct a solo - is to listen to other solos that you like and try to analyze how they do it. If you were to do that with one of my solos you would find that they follow this scheme (hey am I getting predictable or what?!):
1 start on a lower note and maybe grab the listeners attention through a weird bend or note choice
2 remain in the slower (and lower) register for a while, so that you save the good stuff for the climax
3 starting building towards climax: maybe add some more advanced rhythm figures, and start going towards the higher register
4 BOOM - I like when something drastic in the arrangement happens here - so that when you finally go fast the arrangement is there to support you for a very powerful effect to the listener
5 ending - what you do here depends on what comes next in the song, the idea is to find something which gives a smooth transition to the next part!
This is of course just an example - I'll usually do this kind of thing for my metal tunes. Because all songs are different the best rules is [as usual] to listen to the arrangement and try to hear in your head how you would like the solo to sound.
It would be great to hear what others think as well - we've probably got more skilled soloists here than anywhere else!