Leveling the playing field between relatively well-off teaching hospitals and struggling local providers is the linchpin of an ambitious health care restructuring scheme adopted late Thursday night after two days of marathon deliberation by the State Senate.

The senate measure would – controversially – more closely police pharmaceutical prices, and fine big hospitals when costs rise too quickly.

Democrats who sponsored the bill held that it will improve care and contain costs. Republican opponents maintained that more regulation would lead to more bureaucracy and, thus, to higher costs.

The chamber divided along party lines: the 33 Democrats voted in favor, the six Republicans voted against.

Allowing  smaller community hospitals to charge more for their services so that the cheaper alternative providers can compete with the state's pricier teaching hospitals is part of the senate's plan to reshape the cost of health care. 

Rises in health care costs for for the state, private employers and out-of-pocket consumers are causing more and more money to be poured into the hospital system. Some public and private sector leaders say that's not sustainable.

The bill also contains incentives for health care providers to change from fee-for-service to more result-oriented health care.

The bill would would create new licensed positions so non-physicians could treat more patients. For example, one of the 162 amendments to the 100-page bill, would change the rules for treating glaucoma.

"Unlike 49 other states - again, 49 other states, Massachusetts stands alone in restricting the ability of optometrists to treat glaucoma. This forces patients in the Commonwealth to pursue more expensive and inconvenient appointments for a disease that affects thousands of local individuals," Sen. Michael Moore said.

Republican opponents reject the idea that the state should regulate the health market more than it already does and worry about making big changes while congress works to end the Affordable Care Act (ACA).

Gov. Charlie Baker, one of many Republican state officials who support the ACA, nevertheless sounded an alarm. Baker fears that the senate's approach may prove to be too costly.

Baker has his own ideas on how to reform the state's health care system and he says whatever changes get implemented need to save money for the cash-strapped state budget.

"I think the fact that the Senate has acknowledged that it's bill doesn't really save any money was a good thing, I mean it's basically a statement that they're not trying to save money here, they're not trying to chase reforms that are going to make the program more affordable. What they're doing are chasing a variety of initiatives they believe will make the system better," Baker told reporters Thursday.

The Senate projected that the bill would save MassHealth over $100 million a year by 2020, but it doesn't include the immediate changes to MassHealth coverage that Baker has been pushing for.

Another of the amendments passed by the Senate would require the state to study a shift to a single-payer health care system.

"The current sick-care system has neglected many and, worse, costs more than anywhere else in the world. We can’t wait," amendment sponsor Sen. Julian Cyr said in a statement.

The House is expected to put forward its own bill to bring down health care costs next year. Whether the two chambers can eventually see eye-to-eye and put legislation on Baker's desk will be determined when lawmakers return from holiday break in January 2018.