As you alluded to in the question, medications used for migraine headaches generally fall into two categories, prophylactic (meds taken daily to prevent migraines) and abortive (meds taken when a migraine starts in order to stop it). Your question is about the second group.
“Instantly” (as noted in the comments) is a little absurd; there is obviously some delay between the time of ingestion of the medication and its effect at receptors that provides relief of pain. However, you’re right to note that the time-to-onset of anti-migraine effect is relevant, and this is a case where the available medications do vary in this respect in a way that tempers their usefulness.
Relevant pharmacology: routes of administration
Medications taken orally (by mouth) are generally the slowest to onset of action. Intravenous medications, introduced directly into the bloodstream, are generally the fastest. Perhaps less well-known are other methods that are nearly as fast as IV: sublingual, intranasal, and inhaled. In each of these cases, the medication is placed in apposition to blood vessels that are able to absorb it directly. This only works for certain types of medications (mostly lipophilic ones that can cross into blood vessels), but it’s fast and avoids some of the difficulties of oral administration.* Subcutaneous, transdermal or intramuscular administration is generally also somewhat quicker to reach the bloodstream than oral medications.
Migraines: oral may not be best
For reasons that are not fully understood, abortive medications are more effective when used early in the attack, so the quicker routes of administration are also expected to provide relatively more benefit. In addition, migraine headaches are often associated with severe nausea and vomiting which may limit the utility of oral medications. Even when vomiting is not present, migraines are associated with gastric stasis, meaning that the stomach is slow to empty into the duodenum, the part of the gut where medications are generally absorbed.
Abortive medications for migraines:
- Non-steroidal anti-inflammatory agents (NSAIDs): particularly for mild attacks, aspirin, ibuprofen, naproxen, and other NSAIDs are all effective. The only NSAID available for non-oral use (at least in the US) is ketorolac, which is effective with IV or IM administration (ASA and ketorolac references given below; others available upon request.)
- Triptans: This class of drugs is the mainstay of abortive treatment for moderate to severe migraines. Triptans are available for a variety of routes of administration. Sumatriptan can be given as a subcutaneous injection (usually via auto-injector in the thigh), as a nasal spray, or orally; a transdermal preparation is planned to be marketed in 2015. Zolmitriptan is available for both nasal and oral use. Non-oral routes of administration tend to be fastest. This pharmacokinetic paper demonstrates that nicely:
Image from: http://www.ncbi.nlm.nih.gov/pmc/articles/PMC4232272/ “Powder” here refers to an intranasal powder preparation.
- Ergots: These vasoconstricting medications have a similar receptor activity as Triptans but carry relatively more risk for those with hypertension and cardiovascular disease so are used less frequently. Dihydroergotamine has somewhat fewer side effects than ergotamine itself and is available for intravenous, intramuscular, subcutaneous, and intranasal use.
Notes and references
*For practical purposes, all three of these routes tend to be not quite as quick as would be expected theoretically because a portion of the drug ends up swallowed and subject to all of the usual constraint of oral administration.
Kirthi V, Derry S, Moore RA Aspirin with or without an antiemetic for acute migraine headaches in adults. Cochrane Database Syst Rev. 2013;4:CD008041.
Lipton RB, Stewart WF, Stone AM, Láinez MJ, Sawyer JP. *Stratified care vs step care strategies for migraine: the Disability in Strategies of Care (DISC) Study: A randomized trial. JAMA. 2000;284(20):2599.
Taggart E, Doran S, Kokotillo A, Campbell S, Villa-Roel C, Rowe BH. Ketorolac in the treatment of acute migraine: a systematic review. Headache. 2013 Feb;53(2):277-87.
Tfelt-Hansen P, Saxena PR, Dahlöf C, Pascual J, Láinez M, Henry P, Diener H, Schoenen J, Ferrari MD, Goadsby PJ. Ergotamine in the acute treatment of migraine: a review and European consensus. Brain. 2000;123 ( Pt 1):9.
Tfelt-Hansen P Efficacy and adverse events of subcutaneous, oral, and intranasal sumatriptan used for migraine treatment: a systematic review based on number needed to treat. Cephalalgia. 1998;18(8):532.