A few months ago, Rhode Island state Rep. Brian Kennedy had a mild sinus infection, for which he was prescribed an antibiotic.

That would be unremarkable, except for what happened next. Kennedy had a friend behind the pharmacy counter where he went to fill the prescription. The pharmacist-friend said he would charge Kennedy the retail price for the small drug dose he needed, without going through his insurance company, because the retail price was cheaper than the insurance copayment.

Kennedy won’t name his friend because the pharmacist might have violated a “gag clause” in the store’s contract with a pharmacy benefit management company that handles its drug insurance plans.

Instead, Kennedy and four colleagues, all Democrats, introduced legislation to ban such “gag clauses.” The bill is now in committee.

Lawmakers from at least 30 states considered bills on pharmacy benefits managers this year. Many of the measures would eliminate the so-called gag rule, according to the National Academy of State Health Policy, a Maine-based nonprofit group for state policymakers. New laws have been enacted in more than a dozen states, with more awaiting governors’ signatures.

Legislators were motivated to act on the issue “because it affects the ordinary consumer,” said Richard Cauchi, the health program director for the National Conference of State Legislatures.

“As a consumer you would have no idea how this works,” he said. “Even if you were aware of the issue, it would be hard to know when the person across the counter says, ‘This is $20.’ They would pay the $20, because what is the option?”

Cauchi said the rapid spread of bills among state legislatures is remarkable. “States are sovereign entities; they don’t work in tandem. It’s notable,” he said.

Many consumers know of pharmacy benefit management companies through their brand names, such as Express Scripts, CVS Caremark and OptumRX. The companies, sometimes referred to as pharmacy benefit managers, manage prescription drug plans and serve as go-betweens for pharmacies and health insurance companies.

The gag clauses are inserted into contracts with pharmacies by pharmacy benefit management companies, and they prohibit druggists from telling patients or caregivers about lower prices or cheaper drug options, such as generic drugs. Patients never know that there could be a less expensive way to get their medicines, because their neighborhood pharmacist can’t talk about it lest she violate those contracts.

States have been leading the fight against the gag clauses, although President Donald Trump, in his address May 11 on lowering drug prices, also pledged to put an end to the practice, “which punishes pharmacists for telling patients how to save money,” adding, “this is a total rip-off, and we are ending it.”

Kennedy said he’s “heard from constituents who have run into this problem, and in many cases, I don’t think they are fully aware. It’s not until after the fact that they think about it, particularly the senior citizens.”

Pharmacist Robert Iacobucci Jr., who owns White Cross Pharmacy in North Providence, Rhode Island, sells medicine mostly to nursing homes and long-term care facilities. He doesn’t get many walk-in patients. But he still wants to be able to tell patients and caregivers about cheaper prices and bristles at the restrictions placed on him by pharmacy benefit managers.

“There’s no other profession in the world where you can’t tell your customer how to best utilize their money,” he said.

Independent pharmacies are leading the charge against the gag rules, because unlike the big chains, they are not corporately intertwined with the pharmacy benefit managers.

Anthony Reznik, director of government affairs for Independent Pharmacy Alliance, a trade group based in New Jersey representing 3,000 independents mostly in the Northeast, said lawmakers “on both sides of the aisle are amazed this is for real.”

He said most of his members are afraid to speak to the media or anyone else about the situation because they are concerned they will “get kicked out of the network” of insurance companies.

“It could be the end of their business,” he said. “They are just too scared to talk about it. But the situation is real.”

Pharmacy benefit managers such as Express Scripts, CVS Caremark and OptumRX have recently embraced the anti-gag-rule efforts. Several of the companies have described the gag rules as an “outlier” practice, a description at which Reznik scoffs.

But the companies also don’t want to be restricted.

In February, the Pharmaceutical Care Management Association, which represents pharmacy benefit managers, sued to block an anti-gag-rule law in North Dakota, one of the first states to enact such a law. The complaint said the law imposes “onerous new restrictions on pharmacy benefit managers” and could require disclosure of “proprietary” trade secrets. The case is still pending.

Greg Lopes, spokesman for the association, would not speak on the record about gag rules and referred questions to the organizations’ public statement issued in response to the Trump administration proposal.

“We support the patient always paying the lowest cost at the pharmacy counter, whether it’s the cash price or the copay,” the group statement said.

State Rep. George Keiser, a North Dakota Republican who chairs the state House committee that oversees insurance issues, said he can say “with certainty” that pharmacy benefit management contracts did contain gag clauses recently — that’s what led his Legislature to pass legislation.

“They weren’t disclosing it to the customer, but they were disclosing it to me and other legislators,” he said in an interview. “They argued, ‘We have to have formularies, we have to be able to control them, that’s how we manage costs,’” he said, referring to lists of covered drugs and prices.

But, Keiser said, compared with the examples of cheaper prices provided to the lawmaker off the record by pharmacists, “it was clear that was not in the best interests of the consumer.”