Watch the Strategy 9: Compose Yourself online guitar lesson by Jon Herington from Ear IQ: Soloing Strategies

Now let's take a look at an example of a solo that composing beforehand helped me out.