When it comes to killing pain these days, a prescription for a high-powered opioid is no longer enough. Once you’re taking, say, OxyContin or hydrocodone on a regular basis, you’ll probably get pills for the side effects: pills to control the nausea, pills to regulate your testosterone production, and pills to help you use the bathroom when the drugs numb the receptors in your intestines that are supposed to help move things along.

If you become addicted to painkillers, there are pills to help you stop taking the pills, by reducing the symptoms of withdrawal. And if you take too many pills, there’s a pill for that too. Or, rather, there’s a nasal spray, or an injection, or a nifty $4,100 auto-injector that announces, through a tiny speaker, how to use it to reverse the effects of an overdose.

In the medical world, this phenomenon is known as a drug cascade, and with hundreds of millions of opioid prescriptions flooding American homes, the opioid cascade has become, over the past five years, a multibillion-dollar business. “All of these different medicines just start to pile on,” says Dr. Andrew Kolodny, a senior scientist at Brandeis University and an expert on opioid policy.

In some cases, government initiatives have been the force behind more demand for drugs that treat addiction and overdose. With 33,000 Americans dying of opioid overdoses in 2015 alone, state and federal guidelines have encouraged doctors to co-prescribe opioids with a drug that reverses an overdose–just in case. Police and first responders have stocked up on the overdose-reversal drug too.

In other cases, drugmakers and their investors have marketed a whole new class of follow-on pills, because they know a growth industry when they see one. In 2016, the pharmaceutical companies that make opioid painkillers raked in $8.6 billion in sales for 336 million opioid prescriptions, according to the data firm QuintilesIMS. That’s enough to give pain pills to 9 out of every 10 American adults. It’s also enough to constitute an impressive new customer base for drugs that, for instance, ameliorate the constipation associated with chronic opioid use.

Analysts estimate that the follow-on opioid market is worth at least $3 billion a year. Given current trends, some project that it will top $6 billion by 2022. In most instances, the companies that sell opioids are different from those that profit from the follow-on market, but the economics are inescapably linked: the more people there are on opioids, the more pills that are needed to treat the side effects and complications of their use. “Pharmaceutical companies made billions promoting the aggressive prescribing of opioids,” says Kolodny. “Now they’ll make billions from treating the consequences of overprescription.”

Putting an end to that cycle is complicated by the fact that many of the pills that have been developed to address the explosion in opioid use and abuse are beneficial and much needed. Many save lives. A 2016 study showed that long-term opioid patients who received a prescription for the drug that reverses an overdose had 63% fewer trips to an emergency room after a year. A 2011 Harvard study found that administering a drug known as Suboxone is one of the most effective ways to reduce substance abuse.

“It’s really important for people to understand that some of these treatments are the best for them,” says Dr. Joshua Sharfstein, a dean at the Johns Hopkins Bloomberg School of Public Health. “A lot these companies have taken every possible advantage in the market,” he continues–but that doesn’t mean we shouldn’t use their products.

Finding a way to walk that tightrope–to ensure access to vital medications at reasonable prices, while reining in the profiteers–may well become one of the biggest public-health conundrums of our time. “If there’s a medicine available that saves lives, we need to make sure people can get to it without spending thousands of dollars or raising taxes to pay for it,” says Dr. Barbara Herbert, the former president of the Massachusetts chapter of the American Society of Addiction Medicine. “We need to make the conversation about benefiting the public good.”

When roughly 91 Americans are dropping dead every day of opioid overdoses–in their homes, in their cars–it has a way of grabbing officials’ attention. State and federal lawmakers have responded by promoting access to two medications: naloxone, which can reverse an opioid overdose, and buprenorphine, which helps people control and treat an opioid addiction. Neither drug is under patent. Naloxone has been available for pocket change since 1985. Buprenorphine has been on the market since the 1970s.

But over the past few years, the companies that sell these medications–or have patented and branded innovative ways to administer them–have found themselves at the center of a lucrative new market. Demand has been driven largely by public-health efforts. From 2013 to 2016, three federal agencies, including the Centers for Disease Control and Prevention, issued guidelines urging doctors to co-prescribe naloxone alongside high-risk opioid prescriptions. The 2016 Comprehensive Addiction and Recovery Act doubled down, calling for funds to purchase naloxone and expand access to treatment programs. The same year the Department of Health and Human Services also pushed states to reduce barriers for doctors prescribing buprenorphine.

All 50 states responded in kind, passing laws that make it easier for friends and families of opioid users to access naloxone. Cities, emergency responders and hospitals bought large quantities of the drug, and nonprofits dumped money into promoting its use. Billboards advertising naloxone decorate sidewalks from Knoxville, Tenn., to the Bronx. CVS and Walgreens have made naloxone available over the counter in more than 40 states.

Naloxone is a good drug. People should have access to it. But the companies that make it have also made huge profits off increased demand resulting from the opioid crisis. A March 2016 financial report, paid for by Opiant Pharmaceuticals, which makes Narcan, a type of naloxone, acknowledged that public initiatives and infusions of taxpayer cash had created a market for naloxone 21 times as large as expected. “Estimates suggest naloxone market size is actually $1.3 billion, versus the misconception that it is only $60 million,” the report said. Opiant’s partner, Adapt Pharma, which has licensed the right to sell Narcan, says the report overstates the potential market.

Three of the main companies that make naloxone products raised the prices on their drugs as demand increased. From 2005 to 2014, Hospira, which was purchased by Pfizer in 2015, increased the list price of its 10-milliliter injectable naloxone pack by 2,300%, from $9 to $220, according to data from Truven Health Analytics. (By the end of 2014, the price came down to $158.) From 2001 to 2014, the list price for Amphastar’s 20-milliliter naloxone pack jumped 175%, from $120 to $330. Kaléo raised the price of Evzio, its naloxone auto-injector, by 550%. When it was first introduced in 2014, it cost $575. In 2016, it was $3,750. Kaléo provides its Evzio free of charge to any patient with private insurance and a prescription, and Pfizer donates injections to nonprofits and public-health centers. In all three cases, insurers and hospitals end up paying a lower, negotiated price for all medications. But the fact remains: higher list prices mean everyone buying naloxone–from prisons to police departments–ends up paying more.

Public-health initiatives promoting what’s known as “medication-assisted treatment” for opioid addiction follow a similar narrative. Suboxone, for example, is a combination of buprenorphine and naloxone. Multiple studies indicate that it’s one of the most promising new treatments for opioid addiction. It was developed through a partnership between the U.S. government and the U.K.-based company Reckitt Benckiser. Like naloxone, Suboxone is a good drug, and people should have access to it. But Indivior, the company that now owns the drug, has made huge profits off increased demand.

Last September, 35 states and Washington, D.C., filed a lawsuit against Indivior alleging that it took “deceptive and unconscionable” actions to deliberately subvert competition for Suboxone. The lawsuit points to the fact that, in 2002, the company received a license from the FDA to sell the drug without competition for seven years. But as the license was set to expire, the company launched a film version of Suboxone, which dissolves under the tongue–for which it received new patents ensuring competition-free sales until 2023. Indivior then took the tablet version off the market, which allowed the company to charge more for the licensed film version.

Indivior now enjoys 61% of the U.S. market for opioid addiction treatment and is testing a new way to administer the active ingredients in Suboxone. If approved, it is expected to bring in peak annual net revenues of “at least” $1 billion, according to the company’s financial results. In a statement to TIME, Indivior said it was proud of its work providing options for medication-assisted treatment and will consider itself “most successful when patients no longer need to be treated with our medicines.”

Other addiction-treatment drugs, like Vivitrol and Revia, have also benefited from a flood of federal, state and local funds, doled out through Medicaid, prisons and public health departments. Ohio’s substance-abuse-treatment market, for example, is “worth well over $100 million a year in public money alone,” according to Cleveland’s Plain Dealer. That dynamic is fertile ground for drugmakers’ lobbyists. According to the Center for Responsive Politics, Alkermes, which makes Vivitrol, has spent at least $13.5 million in federal lobbying since 2010, when the drug was approved. It has seen its market share expand. In 2012, Ohio Medicaid bought 100 doses of Vivitrol; in 2016, it spent more than $38 million on 30,000 doses, the Dealer reported. During that same time, its prices rose: a vial of Vivitrol cost $800 in 2009; by the end of 2015, it was $1,309, according to Truven Health Analytics. In a statement to TIME, Alkermes stood by its pricing and marketing. “It is surprising to see coverage attacking the integrity of both Vivitrol and Alkermes at a time when the nation’s focus should be on developing and implementing a comprehensive plan to address the opioid crisis,” a spokesperson wrote.

A different class of drugs–those that treat opioid-induced constipation (OIC)–has seen its profits soar as a direct result of more opioid prescriptions. OIC occurs when opioid painkillers act on receptors in the bowels, slowing and blocking normal function. Historically, the OIC market has been small, limited mostly to people in palliative care. But in recent years, as the customer base has ballooned, so has the price of these medications. From 2007 to 2017, Sucampo Pharmaceuticals and Takeda Pharmaceuticals doubled the price of their OIC drug, Amitiza, from $173 to $350, according to Truven Health. Salix Pharmaceuticals’s OIC drug Relistor costs $1,500.

In 2014, the market for OIC drugs was worth $1.9 billion, according to Credence Research. By 2022, it’s expected to top $2.8 billion. Three years ago, there was only one drug that treated OIC; by 2019, there will likely be eight. “It’s a case of the pharmaceutical industry creating a disease,” says Dr. Mark Publicker, a longtime addiction specialist in Portland, Maine, “and then selling a drug to treat it.” In a statement to TIME, AstraZeneca wrote that “OIC is a real condition that is being undertreated in the market.”

Drugmakers’ price increases and patent gambits in the opioid follow-on market haven’t escaped congressional attention. In June 2016, members of the Senate’s Special Committee on Aging sent letters demanding that naloxone makers account for their price hikes. Three months later, a House subcommittee cited the rising cost of the drug as an example of the need for better federal regulations. It was the latest in a familiar parade of outrage: first there was Turing Pharmaceuticals’ overnight price hikes in 2015, and then there was Mylan’s 500% increase on EpiPens last year. But how do we fix the problem for good?

A 2016 op-ed in the New England Journal of Medicine suggested that the federal government could purchase large quantities of naloxone in the same way it might stockpile a vaccine. Or it could allow cheaper imports, make naloxone available over the counter without a prescription or use provisions within U.S. patent law to compel a drugmaker to produce a less expensive version in exchange for “reasonable royalties.” PhRMA, a trade group that represents drugmakers, cites the National Institute of Health’s goal of encouraging collaboration between government agencies and drug companies. “We all must work together to help craft a multifaceted solution to this multifaceted problem,” said Caitlin Carroll, a PhRMA spokeswoman, in a statement to TIME.

In the meantime, the economic incentives remain perverse. In 2016, the rate of both opioid addiction and overdoses continued to climb. It’s a bull market.

This appears in the July 03, 2017 issue of TIME.

Get The Brief. Sign up to receive the top stories you need to know right now. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Write to Haley Sweetland Edwards at haley.edwards@time.com.