A new study suggests that over-the-counter painkillers like Ibuprofen could prevent two debilitating side effects of marijuana use — learning problems and memory loss — that currently limit the drug's medical value.

In a study published in the journal Cell, researchers say they have pinpointed the molecular pathways responsible for marijuana-induced memory problems.

The high you get from marijuana comes from a chemical called Tetrahydrocannabinol, also known as THC. The chemical works by interacting with receptors on brain cells called cannabinoid receptors. Cannabinoid receptors are concentrated in many different places in the brain. Their ubiquity is good and bad.

THC can bind with receptors that are responsible for regulating relaxation, relieving pain, or suppressing nausea, which is why the drug has been used to treat the symptoms of chemotherapy, epilepsy, anxiety, and countless other ailments.

There are also cannabinoid receptors located in the region of the brain involved in learning and memory, called the hippocampus. When THC binds with cannabinoid receptors in the hippocampus it alters the way information is processed and how memories are formed.

But in a study of mice, researchers were surprised to find that THC increased the levels of an enzyme called cyclooxygenase-2 (COX-2) in the hippocampus.

The COX-2 increase in the brain cells seems to turn down memory-making abilities by decreasing the cell's ability to make connections with other brain cells — and these connections are what underlay our memories.

By stopping this activation of COX-2 the researchers were able to restore the brain cells ability to connect with other cells. More connections mean more memories.

Since over-the-counter pain relievers work by deactivating COX-2 (thus lowering pain signals sent to the body), scientists think they could be used to prevent the unwanted side effects of marijuana.

There are currently no FDA-approved effective medications for prevention and treatment of marijuana-induced symptoms. This discovery has the potential to broaden the use of medical marijuana for a wider range of conditions.