The first step: stop what you're doing and take medication early

The single most effective thing you can do is take pain relief medication as soon as you recognize a migraine is starting—ideally within the first hour. Waiting makes the migraine harder to stop. Over-the-counter options like ibuprofen (Advil, Motrin) or naproxen (Aleve) work for some people, especially if the migraine is mild. Acetaminophen (Tylenol) is less effective for migraine specifically, though some people do get relief from it.

If over-the-counter medication doesn't work for you, your doctor can prescribe a triptan—a class of drugs designed specifically for migraine. Common triptans include sumatriptan (Imitrex), rizatriptan (Maxalt), and zolmitriptan (Zomig). These work by narrowing blood vessels and blocking pain pathways in the brain. Triptans are most effective when taken early, and they come in tablets, dissolving tablets, nasal sprays, and injections. If one triptan doesn't work, another one might—people respond differently to different versions.

Some people need a combination: a triptan plus an NSAID like ibuprofen together can work better than either alone. Your doctor can recommend what combination makes sense for you.

Key Takeaways

  • Taking medication within the first hour of migraine onset is far more effective than waiting, whether you use over-the-counter pain relievers or prescription triptans.
  • Triptans are prescription drugs designed specifically for migraine and work by affecting blood vessels and pain signals in the brain.
  • Resting in a dark, quiet room and applying ice or heat can reduce pain while medication takes effect.
  • If you have migraines more than four days per month, preventive medication taken daily can reduce how often and how severely they occur.
  • Keeping a migraine diary—noting when they start, what triggered them, and what helped—gives your doctor concrete information to guide treatment.

Creating the right environment while medication works

While your medication takes effect, your surroundings matter. Most people find that lying down in a dark, quiet room reduces pain faster than staying active. Light and sound can intensify migraine pain, so closing curtains and silencing notifications helps. If you're at work or somewhere you can't lie down, even dimming your screen and using earplugs can make a difference.

Temperature also plays a role. Some people get relief from applying ice to their forehead, temples, or the back of their neck. Others prefer heat—a warm compress or hot shower. There's no universal answer; you'll learn what your body responds to. A cool, damp cloth on your forehead is a neutral option that works for many people.

Staying hydrated matters too. Dehydration can trigger or worsen migraines, so drinking water during an attack can help, though it won't stop one that's already started. If nausea is part of your migraine, sipping water slowly is easier than drinking a large amount at once.

When to consider preventive medication

If you have migraines more than four days per month, preventive medication taken daily can reduce how often they occur and how severe they are. This is different from the medication you take during an attack—preventive drugs work over time to lower your overall migraine frequency.

Common preventive medications include beta-blockers like propranolol (Inderal), tricyclic antidepressants like amitriptyline (Elavil), and anticonvulsants like topiramate (Topamax). Newer options include CGRP monoclonal antibodies—drugs like erenumab (Aimovig), fremanezumab (Ajovy), and eptinezumab (Vyepti)—which block a protein involved in migraine. These are injected monthly or quarterly and can be very effective, though they're expensive and not all insurance plans cover them immediately.

Preventive medication takes weeks or months to show its full effect, so you won't feel relief right away. Your doctor will start at a low dose and adjust based on how you respond. Finding the right preventive drug often involves some trial and error.

Tracking patterns to guide your treatment

Keeping a migraine diary is one of the most useful things you can do. Write down the date and time each migraine starts, what you were doing beforehand, what you ate that day, your stress level, where you are in your menstrual cycle if that applies, and what medication you took and whether it worked. Over weeks and months, patterns emerge: certain foods, stress levels, sleep changes, or hormonal shifts that consistently trigger your migraines.

This information is invaluable to your doctor. Instead of saying "I get migraines sometimes," you can say "I get a migraine about twice a month, usually the day after I skip breakfast or when I'm under deadline stress, and sumatriptan works if I take it within an hour but not after." That specificity lets your doctor recommend the right preventive strategy and medication dose.

You can use a paper notebook, a notes app on your phone, or one of several migraine-tracking apps. The format doesn't matter—consistency does.

What to do if your usual medication stops working

Some people develop medication overuse headache (sometimes called rebound headache) if they take pain relief medication more than 10 to 15 days per month. Paradoxically, using medication too often can trigger more frequent headaches. If you notice your migraines are becoming more frequent or your medication is working less well, talk to your doctor before increasing your dose.

The solution is usually to stop or reduce the medication for a period—typically a few weeks—under medical supervision. During that time, migraines may temporarily worsen before they improve. Your doctor may prescribe a bridge medication to manage the transition, or recommend preventive medication to reduce how many migraines you have while you're cutting back on acute medication.

If a medication that used to work suddenly stops working, it may be that your migraine pattern has changed, or you may need to try a different drug. This is another reason to track your migraines: you'll notice the change and can report it to your doctor.

Non-medication approaches that have evidence behind them

Medication is the most effective treatment, but several non-drug approaches have research support. Regular aerobic exercise—30 minutes most days of the week—reduces migraine frequency for many people. Stress management through meditation, progressive muscle relaxation, or cognitive behavioral therapy can lower how often migraines occur. Maintaining consistent sleep and wake times, even on weekends, helps prevent migraines triggered by sleep disruption.

Certain supplements have some evidence: magnesium, riboflavin (vitamin B2), and coenzyme Q10 may reduce migraine frequency in some people, though the effect is usually modest. Botulinum toxin (Botox) injections are FDA-approved for chronic migraine (15 or more headache days per month) and work for some people, though it takes several weeks to see results and requires repeated injections every 12 weeks.

These approaches work best alongside medication, not instead of it. If you're interested in trying a supplement or starting an exercise program, mention it to your doctor—some supplements can interact with migraine medications.

When to see a doctor about your migraines

See your doctor if you have migraines for the first time, if the pattern of your migraines changes suddenly, or if your usual medication stops working. Also see a doctor if migraines are happening more than four days per month, if they're interfering with work or daily life, or if you're taking pain medication more than 10 days per month.

Go to an emergency room or call 911 if a migraine is accompanied by sudden severe symptoms you haven't had before: sudden weakness or numbness, vision changes, difficulty speaking, confusion, or a stiff neck. These can signal something other than migraine that needs immediate evaluation.

Your primary care doctor can often manage migraines, but if your migraines are frequent, severe, or not responding to standard treatment, a neurologist or headache specialist can offer more specialized options and may have access to newer medications.

Frequently Asked Questions

Can I take migraine medication every day to prevent attacks?

No—daily pain medication causes medication overuse headache and makes migraines worse overall. Preventive medications are different drugs taken at low doses specifically designed for long-term use. If you're taking pain medication more than 10 days per month, talk to your doctor about switching to a preventive medication instead.

Why does my migraine medication work sometimes but not other times?

Timing matters most: medication works better if taken within the first hour. Severity also plays a role—medication is less effective against a severe migraine than a mild one. If you're taking pain medication frequently, medication overuse headache can make it less effective. Keeping a diary helps you spot these patterns and discuss them with your doctor.

Is it safe to take a triptan if I have heart problems?

Triptans narrow blood vessels, so they're not safe for everyone with heart disease. Tell your doctor about any heart conditions, high blood pressure, or family history of heart disease before taking a triptan. Your doctor can determine whether a triptan is safe for you or recommend an alternative.

How long does it take for preventive migraine medication to work?

Most preventive medications take four to eight weeks to show their full effect, though some people notice improvement sooner. Your doctor will usually start at a low dose and increase it gradually. If a medication isn't working after eight to twelve weeks at a full dose, your doctor may recommend trying a different one.

Can caffeine help or hurt a migraine?

Caffeine can help pain medication work better, which is why some migraine drugs include it. However, regular caffeine use can trigger migraines in some people, and suddenly stopping caffeine can trigger a migraine too. If you drink caffeine regularly, keep your intake consistent. During a migraine, a small amount of caffeine with your medication may help, but it won't stop the migraine on its own.