Hospitals and doctors, who tend to benefit from the current system, fought to defeat solutions that would lower their pay. Insurance companies and large insurers groups, on the other hand, have wanted a stronger ability to negotiate lower payments to the types of medical providers who can currently send patients surprise bills.

Legislation nearly passed last December, but was scuttled at the 11th hour after health providers lobbied aggressively against the deal. Private-equity firms, which own many of the medical providers that deliver surprise bills, poured tens of millions into advertisements opposing the plan. Committee chairs squabbled over jurisdictional issues and postponed the issue.

This year, many of the same legislators behind last year’s failed effort tried again, softening several provisions that had been most objectionable to influential doctor and hospital lobbies. The current version will probably not do as much to lower health care spending as the previous version, but will still protect patients.

After years of defeats, consumer advocacy groups cheered the new legislation.

“This was a real victory for American people against moneyed interests,” said Frederick Isasi, executive director of Families USA. “This really was about Congress recognizing in a bipartisan way the obscenity of families who were paying insurance still having financial bombs going off.”

The final compromise would require insurers and medical providers who cannot agree on a payment rate to use an outside arbiter to decide. The arbiter would determine a fair amount based, in part, on what other doctors and hospitals are typically paid for similar services. Patients could be charged the kind of cost sharing they would pay for in-network services, but nothing more.

This type of policy is generally seen as more advantageous to health care providers than the other proposal Congress considered, which would have minimized the role of arbiters and instead set benchmark reimbursement rates. Several states have set up their own arbitration systems, and have found that most price disputes are negotiated before an arbiter is involved.

“If this bill will force them to come to the table and negotiate a solution, it will be a definite win for everybody,” said Christopher Garmon, an assistant professor of health administration at the University of Missouri, Kansas City, who has measured the scope of the problem.