An acute migraine is due to rapid vasodilation which causes pain. Vasoconstrictors combat this, thus the pain caused by the vasodilation goes away.
Serotonin 1D/B receptor agonists are vasoconstrictors (Sumatriptan, Naratriptan, Rizatriptan) in the intracranial cavity and combats the pain in a migraine
Uteroselective ergovine causes vasoconstriction and is used as a migraine prophylaxis
Ergotamine causes vasoconstriction and is used in acute migraines and cluster headaches.