What stops the pain of a migraine headache?
In order to answer your question, we must differentiate from stopping pain and stopping the occurrence of migraines.
Since a migraine headache is quite different from what might be called a common headache, what stops the pain of a migraines is going to be different. The most readily used remedy for a common headache is simple aspirin. However, aspirin doesn't have the same effect on a migraine headache.
You can use aspirin to relieve some of the symptoms of migraines, but not necessarily the pain. To relieve the pain you must use what is called a vasoconstrictor. This is how pharmaceutical treatments end the pain cycle.
With that said, over the counter remedies that claim to help with migraines all have caffeine in them as the "special ingredient" that helps with the migraine. Why? Caffeine is a short-term vasoconstrictor.
Here is how it works. When you have a migraine, the pain you feel is from the hair like nerve fibers in your head as they are being squeezed. These fibers are part of the trigeminal nerve that runs from your temple by your ears to the front and to back of your eyes on each side. These nerves are intertwined with tiny blood vessels and when the blood vessels are dilated (expanded by blood), from a chemical reaction that is occurring as the mechanism of the migraine syndrome, they pinch the nerves.
To demonstrate this affect, think of the fingers of your left hand as the nerve fibers and now squeeze those fingers with your right hand. That hurts! And so do the nerves when squeezed by expanding blood vessels.
What is needed to relieve the pain is something to reduce these expanding blood vessels. That something is called a vasoconstrictor and that is what the pharmaceutical migraine pain relievers are. They make the blood vessels shrink or constrict for a period of time.
Caffeine does the same thing for a short period of time. For this reason, drinking some coffee or coke products can have similar effect as taking over-the-counter pain reliever. The bottom line is in order for the migraine pain to actually be relieved, the blood vessels must be constricted.
Some people talk about marijuana for migraines. Marijuana (CBD or THC) does not have the properties to help migraines. In fact, it has the opposite effect. THC acts as a smooth-muscle relaxant, relaxing the walls of the blood vessels (dilation), which expands them and increases blood flow to put pressure on the nerves when the vessels swell up.
Triptan drugs are still the best way to end a migraine in progress. See Triptans for Migraines