“It’s hard to stay straight and be good,” said Ms. Kelly, who is undergoing treatment, “because there’s just heroin everywhere.”

Matthew J. Maletta, executive vice president and chief legal officer at the drug company Endo, said a comprehensive solution “must not only consider the product supply chain, but also individual patient risk factors and the role of prescribing health care providers.” Criminal trafficking of the drugs, including illegal internet sales and importation, also must be addressed, he said.

The legal battle is playing out as the sale of prescription opioids, which include oxycodone and hydrocodone, have quadrupled since 1999, as have overdose deaths. More than 183,000 people died from overdoses tied to prescription opioids in the 15 years leading up to 2015. Life expectancy in the United States dropped for the second year in a row in 2016, federal officials reported this week, largely driven by drug overdoses, the vast majority of which were opioid-related. And the larger drug crisis, including heroin and fentanyl obtained illicitly, is swamping the resources of local governments and draining their budgets, officials say.

Summit County officials say they spent $66 million dealing with the crisis between 2012 and last year. The county’s child protective agency spent more than $21 million in that period relocating children from homes where a relative was using opioids. Akron firefighters average around 100 overdose responses each month. And a mobile morgue was brought in when the medical examiner ran out of room.

“We’ve had enough here,” said Ilene Shapiro, the county executive, who has declared a public health emergency. She said she hoped the courts could force changes in the way the drugs are marketed and, perhaps, impose a hefty financial settlement or judgment.

In Barberton, a small city in Summit County that is also suing, rookie police officers must quickly master how to make death notifications, how to refer addicts to treatment and how to administer Narcan, the overdose antidote. The police chief, Vince Morber, said the pharmaceutical companies “owe us an apology.”