When I started working as a medical resident, in 2004, I heard from a patient I had inherited from a graduating resident. The patient had an appointment scheduled in a couple weeks. “But I need your help now,” he said.

He was a former construction worker who had hurt himself on the job a couple of years earlier. He told me, “I also need some more OxyContin to tide me over until I can see you.” The hospital computer system told me that he had been taking twenty milligrams of OxyContin, three times a day, for at least the last couple of years. I had rarely seen such high doses of narcotics prescribed for such long periods of time. I’d seen narcotics prescribed in the hospital to patients who had been injured, or to those with pain from an operation or from cancer. But I didn’t have much experience with narcotics for outpatients. I figured that if the previous resident—now a fully licensed doctor—was doing this, then it must be O.K.

What I didn’t know was that my time in medical school had coincided with a boom in the prescribing of narcotics by outpatient doctors, driven partly by the pharmaceutical companies that sold those drugs. Between 1999 and 2010, sales of these “opioid analgesics”—medications like Vicodin, Percocet, and OxyContin—quadrupled.

By 2010, the United States, with about five per cent of the world’s population, was consuming ninety-nine per cent of the world’s hydrocodone (the narcotic in Vicodin), along with eighty per cent of the oxycodone (in Percocet and OxyContin), and sixty-five per cent of the hydromorphone (in Dilaudid).

As narcotics prescriptions surged, so did deaths from opioid-analgesic overdoses—from about four thousand to almost seventeen thousand. Studies have shown that patients who receive narcotics for chronic pain are less likely to recover function, and are less likely to go back to work. The potential side effects of prescription narcotics include constipation, sexual dysfunction, cognitive impairment, addiction, and overdosing. When patients receive narcotics for long periods, they can even become more sensitive to pain, a condition called hyperalgesia. (J. David Haddox, the vice-president of health policy at Purdue Pharma—the manufacturer of OxyContin—acknowledged “opioid analgesics have sometimes been associated with diminished pain relief in the face of increasing doses.”)

And then there are the real-life Walter Whites. I once helped care for a patient with lung cancer who wasn’t taking his narcotics, unbeknownst to his doctors. This patient’s cancer had spread to his bones and other organs, which can be incredibly painful. But he was selling his prescription narcotics to help support his wife and himself. So when given these high-dose narcotics in the hospital, he overdosed—though not fatally, fortunately.

What’s more, no medication reliably eliminates pain in all patients, and narcotics are no exception. And there isn’t good evidence that the prescription of narcotics to treat chronic, non-cancer pain is effective over long periods: most studies of prescription narcotics last only twelve to sixteen weeks.

The use of prescription narcotics, and the problems associated with them, are so pervasive that, last month, the Food and Drug Administration recommended tightening regulations for how doctors prescribe some of the most commonly used narcotic painkillers.

How did doctors, who pledge to do no harm, let the use of prescription narcotics get so out of hand?

Not long ago, doctors in the U.S. prescribed narcotics mostly for short-term pain, like the kind that people experience after a surgery, or for pain related to cancer or to the end of life. Then came two small accounts in medical journals that helped lay the groundwork for an expanded role for prescription narcotics. The first, a hundred-word letter to the editor published in 1980 in the New England Journal of Medicine, reported that less than one per cent of patients at Boston University Medical Center who received narcotics while hospitalized became addicted. The second, a study published in 1986 in the journal Pain, concluded that, for non-cancer pain, narcotics “can be safely and effectively prescribed to selected patients with relatively little risk of producing the maladaptive behaviors which define opioid abuse.” The authors advised caution, and said that the drugs should be used as an “alternative therapy.” They also called for longer-term studies of patients on narcotics; we’re still waiting for those to be performed.

At around the same time, the companies that manufactured these narcotics—including Purdue Pharma, Johnson & Johnson, and Endo Pharmaceuticals—began to aggressively market their products for long-term, non-cancer pain, including neck and back pain. They promoted their prescription narcotics to doctors through ads in highly regarded publications, and through continuing-education courses for medical professionals. They also funded non-profits such as the American Academy of Pain Management and the American Pain Society—the latter previously headed by Dr. Russell Portenoy, a co-author of the Pain study and a proselytizer for expanded narcotics prescribing. The American Pain Society published guidelines that advocated for doctors to expand their use of prescription narcotics to relieve pain.

The Joint Commission, which accredits health facilities, issued pain-management standards in 2001 that instructed hospitals to measure pain—you may be familiar with the smiling-to-crying faces scale—and to prioritize its treatment. Elizabeth Zhani, a spokeswoman for the Joint Commission, told me that their standards “were based upon both the emerging and compelling science of that time, and upon the consensus of a broad array of professionals.” Yet Purdue, according to a report issued by the U. S. Government Accountability Office, helped fund a “pain-management educational program” organized by the Joint Commission; a related agreement allowed Purdue to disseminate educational materials on pain management, and this, in the words of the report, “may have facilitated its access to hospitals to promote OxyContin.”

In a policy drafted by several people with ties to narcotics makers, including Haddox, the Federation of State Medical Boards called on the boards to punish doctors for inadequately treating pain, according to the Wall Street Journal. The Federation also reportedly accepted money from pharmaceutical firms to produce and distribute narcotics-prescribing guidelines. In an e-mail, the Federation maintained: “[Our] most recent policy reflects the considerable body of research and experience accrued since our last series of formal policies related to opioid prescribing and addiction were adopted in 2004. Our latest guidelines, adopted this year, acknowledge that evidence for the risk associated with opioids has surged, while evidence for the benefits of opioids for long-term use has remained controversial and insufficient.”

It took a while for authorities to notice what was going on, but once they did, there was a backlash. The Justice Department, the Food and Drug Administration, and the Senate Finance Committee have investigated these questionable marketing practices and financial relationships. Portenoy defended his relationships with pain-pill companies in an interview with the Wall Street Journal last year, saying that they “would benefit my educational mission, they benefit in my research mission, and to some extent they can benefit my own pocketbook, without producing in me any tendency to engage in undue influence or misinformation.”

In 2007, Purdue Pharma and three of its top executives pleaded guilty to criminal charges that they had misled the F.D.A., clinicians, and patients about the risks of OxyContin addiction and abuse by aggressively marketing the drug to providers and patients as a safe alternative to short-acting narcotics. (Doctors had been taught that because OxyContin was time-released, it wouldn’t cause a high that would lead to addiction.)