President Donald Trump, in a speech in Kentucky in March, called U.S. prescription drug prices “outrageous” — and few Americans would disagree with him.

Yet the ways and means of lowering the high price of drugs is a puzzle Washington has been unable to solve over the years or even paid much attention to despite it being an election cycle issue.

That may be changing. Congressional Republicans and Democrats can’t agree on a national health care insurance system, but they are trying to find common ground in the current session on fixing the problem of drug costs.

It is a complex problem. Drug companies more or less set their own prices, based on demand and the cost of bringing the drugs to market. They also have government rules to protect their investment in new treatments and prevent government price control.

One of those rules requires generic drug makers to prove their product is equal to the branded drug it plans to compete with by providing the government a sample of both. Obtaining a branded sample can take time.

For example, in 2003 the drug company Mylan began working on a less-expensive version of Thalomid, a drug to treat disfiguring lesions from leprosy. It is made by rival company Centrene, costing $8,864 for 28 pills.

Mylan accused Centrene of deliberately dragging its feet for years in supplying a sample of Thalomid to Mylan in order to show the generic and the brand-name were similar.

A bipartisan solution has been offered in legislation sponsored by Republican Rep. Tom Marino of Pennsylvania and Democrat Rep. David Cicilline of Rhode Island. The measure would allow generic drug makers to go to court to force brand drug companies to supply samples.

The current system, said Marino, chairman of the House regulatory reform subcommittee, encourages anti-competitive conduct and “should be put to a stop.”

The Senate’s version of the bill is co-sponsored by Democrats Patrick Leahy of Vermont and Amy Klobuchar of Minnesota, and Republicans Chuck Grassley of Iowa and Mike Lee of Utah.

Grassley and Klobuchar have also introduced a bill that would empower the Federal Trade Commission to prohibit brand drug manufacturers from paying rival drug companies to delay introducing generics on the market.

This tactic is called “pay for delay” and it is practiced by drug companies that hold the patent rights on a drug. Government regulations give the manufacturer a monopoly for the 20-year life of the patent. During that time, the drug’s price can rise as much as the market will bear.

After the patent expires, however, generic drug makers can enter the market, lowering prices. So the idea is to keep generics off the market as long as possible.

Then there is Medicare, the federal insurance program for Americans over 65. It is the largest purchaser of prescription drugs and yet it is barred by law from negotiating drug prices — a restriction favored by the pharmaceutical industry to discourage price control.

There are also bills in Congress to allow Americans to import prescription drugs from Canada, a move drug companies oppose on the ground it would expose consumers to counterfeits.

Grassley said in an interview he’s voted for the Canadian proposal a dozen times over the past 20 years, but it has never mustered enough support to pass.

It is unclear if any of the drug-cost reform measures will win approval in the face of powerful opposition by drug companies. Frederick Isasi, executive director of the health policy group, Families USA, said he’s never seen a “pharmaceutical company lose one vote.”

The Pharmaceutical Research and Manufacturers of America (PhRMA), the industry trade group, is indeed a formidable lobbying force. It argues that drug companies spend billions upon billions of dollars every year to discover and develop new medicines to serve the public and thus need safeguarding rules.

Changing “important protections that facilitate the safe use of medicines to treat patients with serious illnesses” endangers the public, said the group’s spokesman, Andrew Powaleny.

Government figures show Americans spend about a half-trillion dollars on prescription drugs annually, a cost amounting to about 10 percent of the nation’s medical expenses.

Drug prices have risen steadily in recent years, spiking sharply in 2014 and 2015, bringing greater political attention to the issue. They are expected to remain a significant part of health care spending over the next decade, according to the Kaiser Family Foundation, a health policy organization.

Higher deductibles and co-pays have resulted in Americans paying more out-of-pocket costs for medications, especially for popular brand-name drugs.

Drug costs also comprise 20 percent of the cost to health insurance companies, according to America’s Health Insurance Plans, an industry group.

A Kaiser study in June concluded the public is more united in wanting action on drug prices than they are over dismantling the Affordable Care Act or Obamacare.

The study found 60 percent of respondents thought lowering drug prices should be the Congress and President Trump’s top health care priority. Only 32 percent rated repeal of Obamacare number one.

Isasi said growing anger over drug prices comes not only from consumers but also from governors facing higher Medicaid costs. He said the political concern is “changing the dialogue.”