For years, most pharmacists couldn't give customers even a clue about an easy way to save money on prescription drugs. But the restraints are coming off.

When the cash price for a prescription is less than what you would pay using your insurance plan, pharmacists will no longer have to keep that a secret.

President Donald Trump is expected to sign two bills Wednesday that ban "gag order" clauses in contracts between pharmacies and insurance companies or pharmacy benefit managers — those firms that negotiate prices for employers and insurers with drugstores and drugmakers. Such provisions prohibit pharmacists from telling customers when they can save money by paying the pharmacy's lower cash price instead of the price negotiated by their insurance plan.

The bills — one for Medicare and Medicare Advantage beneficiaries and another for commercial employer-based and individual policies— were passed by Congress in nearly unanimous votes last month. A spokesman for Sen. Susan Collins, R-Maine, said her office had been told that the president would sign the bills Wednesday. The White House declined to comment.

"Americans deserve to know the lowest drug price at their pharmacy, but 'gag clauses' prevent your pharmacist from telling you!" Trump wrote on Twitter three weeks ago, shortly before the Senate voted on the bills. "I support legislation that will remove gag clauses.” The change was one of the proposals included in Trump's blueprint to cut prescription drug prices issued in May.

Ronna Hauser, vice president of payment policy and regulatory affairs at the National Community Pharmacists Association, said many members of her group "say a pharmacy benefit manager will call them with a warning if they are telling patients it's less expensive" without insurance. She said pharmacists could be fined for violating their contracts and even dropped from insurance networks.

According to research published in JAMA in March, people with Medicare Part D drug insurance overpaid for prescriptions by $135 million in 2013. Copayments in those plans were higher than the cash price for nearly 1 in 4 drugs purchased in 2013. For 12 of the 20 most commonly prescribed drugs, patients overpaid by more than 33 percent.

Yet some critics say eliminating gag orders doesn't address the causes of high drug prices. "As a country, we're spending about $450 billion on prescription drugs annually," said Steven Knievel, who works on drug price issues for Public Citizen, a consumer advocacy group. The modest savings gained by paying the cash price "is far short of what needs to happen to actually deliver the relief people need."

After the president signs the legislation affecting commercial insurance contracts, gag order provisions will immediately be prohibited, said a spokesman for Collins, who co-authored the bill. The bill affecting Medicare beneficiaries wouldn’t take effect until Jan. 1, 2020.

But there's a catch: Under the new legislation, pharmacists will not be required to tell patients about the lower-cost option. If they don't, it's up to the customer to ask.

The Pharmaceutical Care Management Association, a trade group representing pharmacy benefit managers, said gag orders are increasingly rare. The association supported the legislation. Some insurers have also said their contracts don't include these provisions. Yet at least two members of Congress say they have encountered them at the pharmacy counter.

At a hearing on the gag order ban, Collins said she watched a couple leave a Bangor, Maine, pharmacy without their prescription because they couldn't afford the $111 copayment and the pharmacist did not advise them about saving money by paying directly for the medicine. When she asked him how often that happens, he said every day.

"Banning gag clauses will make it easier for more Americans to afford their prescription drugs because pharmacists will be able to proactively notify consumers if a less expensive option may be available,” she said last week.

When Rep. Debbie Dingell, D-Mich., went to a Michigan pharmacy to pick up a prescription recently, she was told that it would cost $1,300. "After you peeled me off the ceiling, I called the doctor and screamed and talked to the pharmacist," she recalled during a hearing last month. "I'm much more aggressive than many in asking questions," she admitted, and ended up saving $1,260 after she learned that she could get an equivalent drug for $40.

While the legislation removes gag orders, it doesn't address how patients who pay the cash price outside their insurance plan can apply that expense toward meeting their policy's deductible.

But for Medicare beneficiaries there is a little-known rule — not found in the "Medicare & You" handbook or on its website — that helps people with Medicare Part D or Medicare Advantage coverage. If they pay the lower cash price for a covered drug at a pharmacy that participates in their insurance plan and then submit the proper documentation to their plan, insurers must count it toward patients’ out-of-pocket expenses. The total of those expenses are important because that amount affects the drug coverage gap commonly called the “doughnut hole.” (This year, the gap begins after the plan and beneficiary spend $3,750 and ends once the beneficiary has spent a total of $5,000.)

And beneficiaries don't have to wait until the gag order ban takes effect in two years.

The Medicare rule also says that if a senior asks about a lower price for a prescription, the pharmacist can answer.

Rep. Buddy Carter, R-Ga., a pharmacist who sponsored the Medicare gag order bill, said he wasn’t surprised by the bipartisan support for the legislation. "High prescription drug costs affect everyone," he said.

Kaiser Health News is a nonprofit news service covering health issues. It is an editorially independent program of the Kaiser Family Foundation that is not affiliated with Kaiser Permanente.