Health insurance and hospital stocks surged on Friday afternoon after Republican Sen. John McCain said he could not "in good conscience" vote for the Graham-Cassidy bill to repeal Obamacare.

"I would consider supporting legislation similar to that offered by my friends Senators Graham and Cassidy were it the product of extensive hearings, debate and amendment. But that has not been the case," McCain, of Arizona, said in a statement. Sens. Lindsey Graham, R-S.C., and Bill Cassidy, R-La., co-sponsored the legislation.

Shares of Medicaid insurer Molina Health, which had been lower on the session, jumped more than 4 percent, while shares of rival Centene rose more than 2.5 percent. Among hospitals, Tenet Healthcare shares surged 3 percent, while HCA, Community Health and LifePoint Health all rose more than 1 percent.

The health insurance lobby, America's Health Insurance Plans (AHIP), strongly opposes the latest GOP effort to repeal the Affordable Care Act, arguing that it would create tremendous instability in the individual insurance market and Medicaid plan markets.

The bill would shift funding for Obamacare individual tax credits and Medicaid expansion to a block grant system, requiring states to establish their own individual market rules and Medicaid spending plans, starting two years from now.

"It would be very chaotic in the market and extremely challenging for states to be able to set up a new market system for 2020," said Matthew Eyles, AHIP chief operating officer for policy and regulatory affairs.

"To essentially convert the (Medicaid) expansion and individual market into a block grant, and at the same time put in an entirely new funding system through Medicaid ... it's not the right policy," Eyles said. "It's very difficult to do all at once."

The budgetary reconciliation rules that would allow Republicans to repeal the Affordable Care Act by a simple majority vote expire at the end of the month. But before that, on Sept. 27, insurers face a deadline to sign contracts committing to private coverage on the insurance market exchanges.

So far, despite the eleventh-hour uncertainty, insurers seem committed to offering coverage on the exchanges for next year — with big premium increases built in. Earlier this month Anthem said it would re-enter the Virginia exchange market after a local insurance carrier pulled out leaving more than 60 counties without coverage.

"To work pretty proactively with state regulators to make sure nobody is left without access to coverage, you've got to give them credit," said Sabrina Corlette, research professor at the Center on Health Insurance reform at Georgetown University, but "this is short-term."

Without congressional action to address uncertainty over funding for Obamacare cost-reduction subsidies for low-income enrollees and without new guidance on whether the Trump administration will enforce the individual mandate to buy insurance, it's not clear how long insurers will stay in the exchanges.

"Every carrier that agreed to come into a bare county, they basically said, 'This is it. We will step up … but all bets are off for 2019,'" Corlette said.

Insurers had been hoping that a bipartisan bill proposed by Sens. Lamar Alexander, R-Tenn., and Patty Murray, D-Wash., to provide near-term funding to stabilize the individual exchange market could be revived in time for 2018 enrollment.

"Senators Alexander and Murray have been negotiating in good faith to fix some of the problems with Obamacare. But I fear that the prospect of one last attempt at a strictly Republican bill has left the impression that their efforts cannot succeed. I hope they will resume their work should this last attempt at a partisan solution fail," said McCain.

But the clock is running on a bipartisan fix. Open enrollment for the individual market begins on Nov. 1. Insurers say some of the price increases of up to 20 percent for unfunded cost-sharing reductions could still be rolled back and adjusted on the exchanges through mid-October, if necessary.

Despite Friday's gains, the S&P 500 Managed Health Care Index fell for the third straight week, with Aetna as the biggest decliner, down 5.74 percent for the week.