There are various theories regarding how and why a migraine begins, but all agree that constricted blood vessels are a side-effect of the cause, rather than the cause itself. Regardless, when tissue surrounding blood vessels at the base of the skull becomes inflamed, the blood vessels are constricted and become unable to distribute enough blood to the cortex. In an MRI this looks like a slowly spreading wave of cortical depression, known as a CSD. During CSD the neurons depolarize, meaning they can no longer convey a signal and are effectively -- though temporarily -- dead. An MRI experiment done to test for BOLD, a blood factor generated when too little oxygen is being delivered, came out positive in all the brain areas that the CSD spread to over the course of the attack.

It is this CSD that causes the migraine aura, as the visual cortex is located in the occipital lobe, which is the brain area primarily disabled during a migraine CSD. In the 80% of migraine sufferers who don't have aura, the CSD isn't so strong as to interrupt enough neurotransmission that effects are perceptible. Sufferers with aura, however, see the visual effects 99% of the time (as given above) because the occipital lobe, and hence the visual cortex, is the physiological seat of the migraine CSD.

Once inflammation has gone down enough that the blood vessels can let through enough oxygen, a wave of spreading activation happens at the same speed over the same area. This ends all the aura effects in sufferers with aura, and its beginning also signals the beginning of the actual headache. While there is usually enough overlap that the sensory effects may coincide with the pain, the pain almost always continues strongly hours after all aura effects are gone.

Notably, pretty much everything in the second paragraph of borourke's writeup above is false. Migraine aura has zero to do with the brain "apprehending its own subroutines" -- a phrase which treads dangerously close to pseudoscience -- and has little to do with mental processing at all, besides simply shutting it down. Also, so far as I know no recreational drug works in any way even approaching a CSD wave's action on the brain. While recreational drugs generally modify neurotransmission to the extent that it may not work remotely normally, none of them besides the dissociatives actually stop neurotransmission by shutting down neurons. Even the dissociatives temporarily shut down neurons haphazardly throughout the cortex, certainly not over one area that spreads out from a smaller area. As far as personal perception of effects goes, a serious comparison between migraine aura and recreational drugs suggests the author hasn't even experienced one of the two, and perhaps neither.