Can somebody explain the theory behind Rhoads solo here? I have no clue what scales he uses here other than the pentatonic run at the end.
Right, I just had a quick look through it. This is a very rare usage of a 'double harmonic' scale, in this case the double harmonic minor scale, which can also be called the Hungarian Minor scale. It's basically like the regular harmonic minor scale but with the 4th note being raised, so we have the intervals:
R 2 b3 #4 5 b6 7 R
in Diary of a Madman it's in A, so we have the notes:
A B C D# E F G# A

If you play through it you'll see that it's a REALLY weird scale, because there's tons of minor 3rd jumps, and a chromatic passage from the #4th - 5th - b6th, which has a very exotic sound to it. Of course Randy throws in a few other notes, but most of the solo (apart from the pentatonic run at the end) is based around the A Hungarian Minor scale.

Here are some links if you wanna read more into it: