PHOENIX (AP) — A new mouth spray that delivered the powerful painkiller fentanyl to end-stage cancer patients wasn't selling as well as anticipated. So drug company executives moved quickly to make its production worthwhile.

U.S. court records in the case against an immigrant billionaire who is one of Arizona's wealthiest men describe the daunting market challenges that Insys Therapeutics founder John N. Kapoor and fellow executives faced after launching the opioid medication Subsys in 2012.

The highly addictive drug was going to cost a cancer patient up to thousands of dollars a month to control intolerable levels of pain. It could only be prescribed by a medical practitioner registered with the Drug Enforcement Administration, and it was among several cancer pain medicines already available.

Five years later, Subsys is at the heart of the case against Insys Therapeutics executives, including Kapoor, 74, of Phoenix, who is charged with leading a nationwide conspiracy to bribe doctors and pharmacists to widely prescribe the potent painkiller to people who didn't need it.

Defense attorney Brian T. Kelly, a high-profile Boston lawyer, has said Kapoor is not guilty.

It comes amid an opioid epidemic that claims thousands of lives each year and led President Donald Trump to declare a nationwide public health emergency.

The case is just the latest example of how profits have become more important than health for many U.S. pharmaceutical firms, New Jersey-based health care analyst Steve Brozak said Friday.

The aggressive market tactics that federal prosecutors described at Insys have become acceptable, said Brozak of WWB Securities, a health care research firm that tracks companies in the sector.

"The only reason (Kapoor) was put in handcuffs and did the perp walk is because the marketing involved an opioid," he said. "This is an example of a greater addiction, not to opioids, but to big sales. The opioid crisis is the logical extension of the earnings demand."

To make Subsys more profitable, Insys executives turned to aggressive marketing tactics, such as bribes and kickbacks that included "speaker fees and honoraria for marketing events, food and entertainment" for doctors and pharmacists who prescribed the drug, according to an updated federal fraud and racketeering indictment in the ongoing case. The new charges were filed this week in Massachusetts.

In exchange, the practitioners are accused of writing large numbers of prescriptions for patients, most of whom were not diagnosed with cancer. Prosecutors say the scam stretched across the U.S., involving pharmacies and pain management clinics and practitioners from Saginaw, Michigan, to southwest Florida and Laredo, Texas.

Federal prosecutors in Boston first brought the case against six Insys executives and managers, including former CEO Michael L. Babich, who are set to go to trial next year and have pleaded not guilty. The updated indictment unsealed this week brings new charges against them and alleges Kapoor and the others provided kickbacks to doctors and conspired to defraud insurance providers.

The court records describe events that encouraged sales representatives to push practitioners to prescribe ever higher doses of the fentanyl spray. A video at one event purportedly showed company employees dancing, rapping and singing with a life-size bottle of the highest dosage of the spray, suggesting that increased amounts were "not a problem!"

To get paid back by insurance companies that didn't want to fund the drug for non-cancer patients, the company established a "reimbursement center" that used employees to suggest they were calling on behalf of a doctor and the patient in question had cancer — even if that wasn't true, the indictment says.

Kapoor founded Insys Therapeutics in 1990. Its stock price has tumbled amid the legal trouble in recent months, but the company said this week that it is under new management and has assumed responsibility for its former employees' actions.

The drug is question, fentanyl, is useful for managing pain for people with end-stage cancers, said Dr. Karen Sibert, an associate clinical professor with UCLA Health's Department of Anesthesiology and Perioperative Medicine. But opioids are dangerous when used incorrectly and without medical supervision because they can cause a person to stop breathing, she said.

"If you have extreme pain from end-stage cancer, the risk from stopping breathing is an acceptable risk," she said. "But it's not if you are a young person with back pain."

Kapoor emigrated from India decades ago and earned a Ph.D. in medicinal chemistry from the University of Buffalo in New York, where the pharmacy school is named for him and his wife to honor their philanthropy.

In addition to Insys Therapeutics, which went public in 2013, Kapoor founded Illinois-based Akorn Pharmaceuticals. He also has a company that operates seven restaurants.

Forbes said several years ago that Kapoor was worth $2.4 billion. That has fallen amid his company's legal woes, but the magazine still listed Kapoor's worth at $1.75 billion on Friday.

A judge set bail for Kapoor at $1 million and said he must wear electronic monitoring and surrender his passports.