The lawyer for plaintiffs challenging a key part of Obamacare faced pointed questions by several Supreme Court justices Wednesday, who asked if his clients even had the legal right to dispute the legality of tax credits that help more than 7 million people in 37 states buy insurance plans from HealthCare.gov. Nearly 9 in 10 HealthCare.gov customers receive subsidies.

Justice Anthony Kennedy, who is considered a likely swing vote in the case, suggested there is "a serious constitutional problem" with a major claim by the plaintiffs in the case, known as King v. Burwell.

And Justice Samuel Alito voiced the possibility that if the Supreme Court rules the HealthCare.gov subsidies are illegal, it could stay its ruling until the end of the year. That would mean that people who rely on the tax credits to make their plans affordable would not be pressured to drop their insurance in the middle of the plan year.

The court is expected to rule on the case in late June.

The stocks of major insurers and hospitals increased in price on news of Kennedy's questions for the plaintiffs.

The questions played out during oral arguments at the high court, which is considering a case that could possibly eliminate billions of dollars in federal subsidies given to customers of HealthCare.gov. A victory for the plaintiffs would, in the absence of a fix by Congress, lead to an exodus of millions of people from the individual insurance markets in HealthCare.gov states, and much higher premiums for the remaining customers, experts agree.

Plaintiffs claim tax credits can only be given to customers of an insurance marketplace set up and run by an individual state. HealthCare.gov was set up by the federal government after most states refused to set up their own exchange as authorized by the Affordable Care Act.

Read MoreMake or break time for Obamacare

Michael Carvin, the plaintiff's lawyer, hinges his challenge on language in the ACA that discusses how tax credits for premiums can be issued to customers of an exchange "established by the State." Congress, according to Carvin, meant the subsidies to be an incentive to set up the exchanges. States that failed to do so, under that argument, would deny their residents help to buy Obamacare plans.

Getty Images

Supporters of the Affordable Care Act gather in front of the U.S Supreme Court during a rally March 4, 2015 in Washington.

But the Obama administration says that even though the ACA does not talk about such subsidies being given to customers of a federal exchange set up if a state fails to do, the law effectively authorizes that assistance because it contemplates HealthCare.gov being necessary, and because the law's primary goal is getting uninsured people health coverage. Obamacare advocates argue it would be absurd to set up an exchange that did not offer low and middle income customers the same kind of financial help being given to people in states that set up their own markets.

Kennedy's point is possibly telling: In the 2012 Supreme Court decision that upheld much of Obamacare, the court rejected the law's provision that forced states to expand eligibility for their Medicaid programs to include more adults or face the loss of federal Medicaid funding. The court found that condition was too coercive, and left it up to the states to decide whether to expand Medicaid.

Kennedy later said that if the subsidies to a state's residents were conditional on whether their state set up its own exchange, it would not be a "rational choice to a state to make" to refuse to establish such a marketplace.

Elizabeth Wydra, chief counsel of the Constitutional Accountability Center, said she was encouraged by Kennedy's comments. "It shows just one of the many problems with the challengers' interpretation, and Justice Kennedy says it's a serious one."

"I think it's just one of many hurdles that the plaintiffs need to get over," said Wydra, an Obamacare supporter who was in the courtroom during arguments.

Plaintiffs' standing

Carvin, the plaintiff's lawyer, also faced repeated questions by Justice Ruth Bader Ginsburg about the legal standing of the four plaintiffs challenging the legality of the subsidies.

Their standing became an issue in recent weeks after reports that two of them may have been eligible for health coverage from the Veterans' Affairs Department because of their military service, and questions about whether the other two had earned enough money to reach the income level needed to qualify for Obamacare subsidies.

Carvin defended the standing of the plaintiffs, and even got some assistance later from the government's lawyer, Solicitor General Donald Verrilli, who told the justices the administration assumed that at least one of the plaintiffs had proper legal standing.

Hans von Spakovsky, a senior legal fellow with the conservative Heritage Foundation, noted that "the justices were so intrigued by this case that they gave both sides extra time in the courtroom, going beyond the extra hour that was set aside."

"It seemed to me that the liberal justices were almost desperate to distract the court from the statute language, which is very plain and straightforward," he said. "If you just look at the statute language, the case is clear and there is no argument as to the invalidity of the administration's position."

Experts have said that without the tax credits that are being challenged, the actual price for the insurance would rise by an average of 255 percent.

Michael Cannon, director of health policy studies at the libertarian Cato Institute and one of the architects of the challenge, said he expects to win.

Cannon said Chief Justice John Roberts and Kennedy "expressed skepticism [about] the government's argument that the court should defer to the IRS' interpretation" that the ACA allows subsidies to be issued to customers of a federally run exchange.

Cannon said the IRS interpretation has led to illegal taxation of Americans to fund the federal subsidies for HealthCare.gov enrollees, and will lead to illegal taxing of employers and individuals who fail to comply with Obamacare mandates that require large employers to offer workers affordable health insurance and for most Americans to have some form of health coverage. The fines for those mandates are linked to the availability of subsidies.

"King v. Burwell is perhaps the most egregious case of IRS abuse in our nation's history," said Cannon. "Two lower courts have already found the IRS is unlawfully subjecting more than 57 million Americans to illegal taxes, in the form of Obamacare's individual mandate and employer mandate. Those illegal taxes have cost millions of taxpayers thousands of dollars in lost wages. The Supreme Court has an opportunity to show that the IRS does not have a roving license to impose taxes wherever it likes. Restraining the IRS will create an opportunity for health care reforms that reduce the cost of health care."

White House spokesman Josh Earnest said that President Barack Obama was briefed about the oral arguments by the White House counsel Neil Eggleston.

Earnest said the administration "is quite pleased with the performance of the solicitor general," according to The Washington Post.

Earnest also said the administration has "no contingency plan that could be implemented to prevent the catastrophic damage" if the high court renders the HealthCare.gov subsidies illegal.

"We would see millions of people lose their health insurance, prices would likely go through the roof, and there's likely not a whole lot the government could do about it," Earnest said, according to the Post.

Anne Filipic, president of the Obamacare advocacy group Enroll America, said, "Like the millions of Americans who rely on tax credits from the Affordable Care Act for access to health insurance and care, we'll be closely watching this case as it unfolds."

"Our staff and volunteers across the country speak every day to Americans whose lives have been transformed by access to quality, affordable health coverage,and as many as 9.6 million of those Americans could lose their subsidies – and their ability to pay for their insurance – unless the case is dismissed," Filipic said. "That would be a devastating blow to millions of American families. The intention of the Affordable Care Act is clearly to make health insurance affordable for all Americans wherever they reside, and it is absolutely critical that these tax credits continue to be available to families who need them."