SACRAMENTO – Frustrated by the rising cost of prescription drugs, California health advocates hope sunlight and a dose of shame will discourage drugmakers from raising their prices too quickly or introducing new medications at prices that break the bank.

They’re promoting legislation that would require drugmakers to provide advance notice before making big price increases. Pharmaceutical companies have come out in force against the measure, warning it would lead to dangerous drug shortages.

Attention to prescription drug pricing has mounted since Turing Pharmaceuticals bought an old drug commonly used with HIV patients and raised the price from $13.50 per pill to $750. The company’s combative chief executive, Martin Shkreli, was widely castigated for the price hike.

“Yes, they should make a profit, but not so much they gouge the public at the expense of the consumer and the taxpayer,” Sen. Ed Hernandez, a Democrat from Azusa who wrote the legislation, said of drug companies. “There needs to be a balance.”

Vermont passed the nation’s first drug price transparency legislation earlier this year, and similar measures were introduced in at least five other states, including California.

California voters also will decide in November on a ballot measure that would prohibit the state – which covers millions of poor people, inmates and government retirees – from paying more than the U.S. Veterans Administration for drugs. The VA’s massive negotiating power allows it to secure some of the lowest rates for drugs.

Both presumptive presidential nominees have cited drug prices in their campaigns. Republican Donald Trump suggested ending a restriction on Medicare’s ability to negotiate drug prices. Democrat Hillary Clinton has slammed drug pricing she labels predatory.

Drug costs represent about 10 percent of overall health care spending and about 19 percent of costs for employer-sponsored health plans, according to the Kaiser Family Foundation. After several years of modest growth in drug spending, which even decreased in 2010 and 2012, pharmaceutical spending spiked 11.4 percent in 2014, according to the Kaiser’s analysis of data from the Centers for Medicare and Medicaid Services. Estimates for 2015 suggest prices rose 6.8 percent.

Experts attribute the recent rise in drug spending to the proliferation of new specialty drugs, many of them used to treat cancer, and fewer patent expirations that allow for generic competition.

Sovaldi, which can cure Hepatitis C without the excruciating side effects of earlier treatments, debuted in 2014, at a shocking cost of more than $80,000 per course of treatment. The price has since come down.

California’s SB1010 would require pharmaceutical companies to provide advance notice to drug purchasers before increasing the price of a drug by 10 percent or $10,000 a year. For generics, the threshold is $100 a month or 25 percent. Insurance companies would be required to report data on drug prices to state regulators, including the portion of premiums attributable to pharmaceuticals.

Proponents hope the advance notice will give governments, insurers and pharmacy benefit managers a chance to negotiate.

But drugmakers warn it could create regional shortages of some drugs if large pharmacy chains or distributors horde medications to beat the price increase. That would create an environment for speculators to drive prices up, not down.

Drug manufacturing is a highly regulated industry with complex supply chains that relies on predictable demand, said Brett Johnson, director of state and local policy for the California Life Sciences Association, an industry group.

“This isn’t an industry where they can really react quickly to surges in demand,” Johnson said. “So that creates complications when we’re talking about things like price signaling.”

Drugmakers also say the transparency requirements would create a distorted view of drug pricing, failing to account for negotiated discounts or price decreases.

The bill’s supporters dispute the risk of shortage, noting many of the specialty drugs that would trigger the notification have a short shelf life and require careful handling, making it difficult to stockpile them.

The measure has cleared the Senate and is moving through the Assembly, which tends to take a much more skeptical view of business regulations.

The measure barely survived a hearing in the Assembly Health Committee last month and faces an even tougher test in the Appropriations Committee when lawmakers return to the Capitol following a July break.

“These medications are not like other products,” said Anthony Wright, executive director of Health Access, one of the advocacy groups sponsoring the measure. “People and patients and insurers are often cases not in a position to say ‘no.“’