Migraine headaches hurt. The most common symptom is a throbbing head pain that can be so severe it interferes with day-to-day activities like school or work. People with this type of headache may also experience sensitivity to light, sound and smell, as well as nausea, vomiting and blurred vision. It's the most common disorder worldwide — and the Migraine Research Foundation estimates that at least 39 million Americans suffer with the condition. But relief may be on its way.

A new study reports that a recently developed migraine drug, ubrogepant, can help prevent a migraine from developing.

There was one requirement: participants needed to be tuned into the headache's warning signs and take the drug before the migraine developed. Those symptoms can include sensitivity to light and sound, as well as fatigue, neck pain or stiffness, and dizziness.

Within as little as two hours after taking the medication, people who took the drug were nearly 75 percent more likely to report that they were able to function normally than those who took the placebo.

The study involved over 500 participants who not only had had migraines for a least one year, but also had experienced between two to eight migraine attacks a month over a three-month period before the study began.

All of the participants knew when a migraine was coming on because they experienced signs within a few hours before their migraine started.

The participants were divided into two groups. One group received a placebo, a treatment with no active properties, such as a sugar pill, for their first set of pre-headache symptoms. The next time they experienced symptoms they were given 100 milligrams of ubrogepant.

The second group took ubrogepant for the first instance of symptoms and a placebo for the second instance.

The participants kept track in a diary of how limited they were with their activities after taking the medication at the first sign of symptoms. Using a scale that ranged from zero to four, they entered zero if they were “not at all limited” or “could do everything.” If they felt “a little limited” they rated their pain as 1. If they felt “somewhat limited” it was rated a 2; “very limited” a 3; and “extremely limited” a 4.

Twenty-four hours after taking either a placebo or the medication, 65 percent of the participants who took ubrogepant reported that they were “not at all limited” by a migraine and that they could “do everything” or were “somewhat limited.” This was in contrast to the 48 percent who took the placebo and suffered an attack that interfered with their activities.

Even better, the research team found that as soon as two hours after taking the medication, people who took the drug were 73 percent more likely to report that they were able to function normally than those who took the placebo.

Sensitivity to light, called photophobia, is a common symptom of migraine.

“Improving care at the first signs of migraine, even before headache pain begins, can be a key to improved outcomes,” study author Richard B. Lipton MD, of Albert Einstein College of Medicine in Bronx, New York, and a Fellow of the American Academy of Neurology, said in a press release. “Our findings are encouraging, suggesting that ubrogepant may help people with migraine function normally and go about their day.”

Lipton also noted that participants showed that they could reliably predict their impending migraine headaches based on their headache's warning symptoms. But what can you do if your migraine comes on suddenly with no warnings? The American Migraine Foundation suggests trying these home remedies:

  • Scalp Massages. Applying pressure to muscles can help with relieving tension and stress, which are common migraine triggers. Massages can also help promote blood circulation, which may help relieve pain.
  • Sleep. Too much or too little sleep can cause migraine attacks. In order to avoid an attack, or making migraine symptoms worse, it's important to practice good sleep habits. This includes going to bed and waking up at the same time every day, avoiding screens before sleeping and spending enough time in natural light during the day.
  • Naps can also help. If you feel an incoming attack or are experiencing one, it may help to lay down and snooze for a short while.
  • Exercise. It is not recommended to exercise while experiencing a migraine attack or if you feel unwell. But light-impact exercise, such as walking and yoga, can help some people abort an acute attack.
  • Compresses. Cold compresses have proven to help with migraine attacks. When using compresses, do not leave them on for longer than 15 minutes.
  • Hydration. Dehydration is a common cause of headaches and is thought to be a trigger for migraine attacks. Try to drink the recommended eight glasses per day.
  • Dim the lights. Sensitivity to light, called photophobia, is a common symptom of migraine. Keeping the lights low in your living space or office can help decrease the chances of experiencing an attack.

The study is published in the journal Neurology.