A new study by researchers Ashley Bradford and W. David Bradford at the University of Georgia indicates that legalizing medical marijuana prescriptions for seniors reduces “use of prescription drugs for which marijuana could serve” and also “has a significant effect on prescribing patterns and spending in Medicare Part D,” the Medicare component that pays for prescription drugs for enrollees. The researchers identified nine conditions for which medical marijuana has evidence of efficacy in treatment—including anxiety, depression, sleep disorders, and pain—and compared overall prescriptions for other existing drugs in states where medical marijuana is legal versus states where it is not legal. They also analyzed Medicare Part D spending in states that have legalized medical marijuana.

The spending results showed a modest decrease in Part D spending in 2013 of about $165 million in states that had approved medical marijuana, from a reduction of costlier prescriptions. Bradford and Bradford estimated that the country could save over $400 million annually in Part D costs if every state legalized medical marijuana. That number seems minuscule compared to the $66 billion spent annually on Medicare Part D drugs alone and the almost $400 billion spent on drugs in the country, and it is. But as drug costs have risen even faster than inflation or other medical costs, policies that can slow that rise have been sought by politicians. Legalizing medical marijuana might be the rare policy that can not only halt the yearly rise in some spending categories, but actually reverse it.

But the money that medical marijuana saves in prescription costs is perhaps only a fraction of the money that it really saves in total. Of the conditions and drug categories for which marijuana could serve as a substitute, pain was easily the most common, with around 30,000 Part D prescriptions per physician. That number is astounding, especially considering the next highest category is anxiety, with around 11,000 prescriptions per physician. Bradford and Bradford’s data indicates that states with medical marijuana had pain prescription rates that were 3,600 lower per physician—or 12 percent less—than states without it. That reduction should show up in a reduction of opioid addiction, which itself should lower treatment costs in other Medicare spending categories and reduce deaths.

Seniors represent a very vulnerable risk group for opioid addiction and overdose deaths, and that risk is probably underreported because they are less likely to enter treatment than younger people and also are more likely to die from other causes while suffering opioid addictions. But the nature of care for seniors and the nature of their problems—many deal with chronic, increasing pain as a normal course of other conditions and also are prescribed painkillers after surgery—make exposure to addiction an almost routine part of life. The true costs of opioids may be hidden in or contributing to the jumbled, ballooning mess of elderly and end-of-life care, and Bradford and Bradford’s data suggests that medical marijuana may play a part in diminishing it.