Medical marijuana might help migraine sufferers reduce the frequency of their headaches, a new study suggests.

In the study of 121 people with migraines, 103 said they had fewer migraines after they began using marijuana, the researchers found. Another 15 people said the frequency of their headaches remained the same during the treatment, and three said the frequency of their headaches increased.

Among the people who noticed improvement, the frequency of their migraine headaches decreased from 10.4 headaches per month to 4.6 headaches per month, on average, the researchers found.

"There was a substantial improvement for patients in their ability to function and feel better," study author Laura Borgelt, a professor of clinical pharmacy at the University of Colorado Anschutz Medical Campus, said in a statement.

However, "Like any drug, marijuana has potential benefits and potential risks," Borgelt noted. "It's important for people to be aware that using medical marijuana can also have adverse effects." [Ouch: 10 Odd Causes of Headaches]

In the study, the researchers looked at the number of migraines per month among patients in Colorado whose doctors had recommended that they use medical marijuana to treat and prevent their migraines, between January 2010 and September 2014. The people who had at least one follow-up visit with a doctor were included in the study.

Most people in the study used more than one form of marijuana, including inhaled, smoked and edible forms, the researchers said. The people tended to prefer inhaled marijuana to treat acute migraines, and preferred to use edible marijuana to prevent future migraines from occurring. About half of the people in the study were also using prescription migraine drugs, in addition to marijuana, to treat their headaches, Borgelt noted.

Fourteen people in the study reported experiencing side effects during treatment, such as sleepiness, bad dreams and nausea, the researchers said. There were more side effects associated with the use of edible marijuana than with its other forms.

The researchers said they don't know for sure why or how exactly marijuana may work to treat or prevent migraines. In fact, even the mechanisms of migraine as a condition are still not fully understood. In the study, the researchers were trying to evaluate the result of the treatment, even though they do not fully understand how it may work, Borgelt said.

However, there are several pathways that could explain why marijuana might work for patients with migraines, the researchers said. For example, some researchers have proposed that migraines might have something to do with a problem with receptors in the brain called cannabinoid receptors, which affect some crucial neurotransmitters such as serotonin. Compounds in marijuana may also affect these receptors, they said.

It's also possible that serotonin itself plays a role in migraine headaches, Borgelt said, and some research has shown that THC, the ingredient in marijuana that's responsible for most of its psychological effects, may affect serotonin levels.

People with migraines should not try to self-medicate using marijuana, Borgelt stressed. "Any treatment decision should involve a conversation with their [health care] providers," she told Live Science.

The new study was published Jan. 9 in the journal Pharmacotherapy.

Follow Agata Blaszczak-Boxe on Twitter. Follow Live Science @livescience, Facebook & Google+. Originally published on Live Science.