Watch the Flying in Formation 1 online guitar lesson by Angus Clark from 50 Hard Rock Licks You MUST Know
Pay attention to how the scale changes to fit the harmony beneath it. The overall key is B minor, but the first run is over an E minor chord, so the sound is Dorian. The second run is over an F# major chord, so the scale is B harmonic minor. This is the guitar 1 part of a harmony run, so get it nailed!