Before Philip Seymour Hoffman died, he revealed that he had recently slipped back into a heroin habit after having been clean for more than two decades. The gateway drug for Hoffman, as it is for many thousands of Americans, was prescription painkillers.

When a patient has chronic pain or major surgery, a doctor might prescribe an extremely potent painkiller, such as Vicodin or OxyContin. The patient’s relatives or friends might then raid their medicine cabinet and get their hands on the drugs, too. The pills are highly addictive, and when combined with alcohol or other substances, they can be lethal.

There’s been a threefold increase in the prescription of strong painkillers since 1999, and the drugs now kill more people than car crashes. The problem has escalated so rapidly that last week the DEA tightened restrictions on when and how patients could obtain the prescriptions.

There’s another substance that may help with chronic pain, though: Medical marijuana. According to a study published Monday in JAMA Internal Medicine, the 13 states that had legalized medical marijuana prior to 2010 had a 25 percent lower rate of opioid mortality than those that didn’t. This equates to roughly 1,729 fewer painkiller deaths, just in 2010. The results suggest, in other words, that people were choosing pot over Percocet.