Watch the The Epic online guitar lesson by Angus Clark from Hard Rock Survival Guide: Lead
This kind of form needs a big long solo map, and I've done a couple of things to force myself into sparser phrasing during the top of the solo, specifically having a really prominent delay setting that I'm playing off of. Also, there's no rhythm guitar or keyboard during the top section so to play a bunch of fast stuff would be inappropriate and leave the guitar very exposed - which puts any flaws in one's technique prominently on display. So let's avoid that. Keep it sparse.
Playing off of the delay is great fun and has been done exceptionally well by players like Brian May and others. I start by using a few slow descending bends. A few short, punctuated notes are used to expose the actual delay setting for effect. Simple pentatonic passages are great in this context because the delay can create a harmony part.
As the solo builds up the delay setting is changed (mix and feedback are reduced, which you can do live with presets or a pair of delay pedals). The more subdued setting allows for more definition as I start ramping up in speed. I also start introducing more diatonic work, and eventually a fully arpeggiated section that addresses all of the chord changes. You could stay strictly pentatonic through this whole section, but the vibe I'm shooting for is that the band and the soloist are all joining in on the chord changes. First it's just the keyboard, then the guitars are on the changes, then the bass joins for the heavy section.
The heavy section leads into a key change, where we move to the relative major, and I switch back to mostly pentatonic, cause it's safer. This entire solo can be played on the C# minor or E major pentatonic scale, it just might get a little boring for you and the listeners. It's meant to become grandiose on the major section, so go there. Back to long notes and so forth. One thing that's a real set piece in here is that the rhythm section play an entire run in triplets, which if you get a feel for where it's coming when you practice the piece, you can set it up in the solo so it sounds like they pick up on what you're doing. And that's the magic of the recording process. You have to set yourself up to succeed.