Hospital company Community Health Systems Inc jumped 8 percent, while Tenet Healthcare Corp rose almost 5 percent.
The 2010 law is designed to expand coverage to more than 30 million currently uninsured Americans, through insurance exchanges where people can shop for coverage and an expansion of the Medicaid program for low-income Americans.
Expanding the pool of paying patients stands to benefit hospital companies since they will have more paying customers with insurance instead of uninsured patients.
"The status quo was maintained," said Tim Nelson, an analyst with Nuveen Asset Management. "There was fear that if the mandate went away, hospitals would lose volume. Hospitals should be a major beneficiary of this whole thing, but the uncertainty isn't going away. Now it'll just shift to the election."
Under the law, insurers face government review of premium rate increases, requirements of spending on medical care and fees on the sector starting in 2014.
Shares of five different healthcare companies were temporarily halted, some more than once, after the ruling was announced due to sharp moves.