Coronavirus hospitalizations have soared to all-time-highs, threatening to strain health-care facilities across the U.S. again. But this time, investors are less concerned.

Shares of several publicly traded hospital systems finished November with their best performances in months, with national hospital operators including
Tenet Healthcare Corp.
and
HCA Healthcare Inc.
both jumping at least 21%. That is far better than the S&P 500’s 11% monthly gain and the 7.8% rise for the index’s health-care sector.

November sent the U.S. stock market on yet another wild ride, driven by a string of positive Covid-19 vaccine results and a quicker-than-expected resolution of the presidential election. Both events helped push major U.S. stock indexes to new records as traders scrambled to scoop up investments that have been beaten-down this year. In addition to hospital stocks, shares of retailers, restaurants, energy stocks and cruise liners also jumped. Elsewhere across financial markets, crude oil, junk bonds and metals such as copper and platinum rallied.

On its face, the recent outperformance of hospital stocks could be perceived as one of the beneficiaries of the latest round of bargain-hunting by investors—after all, hospital chains such as Tenet and
Universal Health Services Inc.
are both still trading 11% or more below their respective 2020 highs after plunging during the market rout.

Yet some investors and analysts say they also believe that the recent rally has legs that could extend beyond November, even as rising Covid-19 cases threaten to overrun hospitals again.

“We’re bullish,” said A.J. Rice, a health-care services analyst at Credit Suisse, which has an “outperform” rating on Tenet, Universal Health and HCA. “Absent a national lockdown again, we think these companies can deliver on expectations and even exceed them. And that should be sufficient to at least relatively outperform the market overall.”

Driving the optimism around hospital and health-care facilities, analysts and investors say, is increased clarity about the months ahead. Although two key Senate seats in Georgia won’t be decided until the January runoff election, many traders are anticipating that the government will remain divided—an outcome that reduces the chances of a major health-care overhaul.

And statements from some of the Supreme Court’s conservative justices suggest the Affordable Care Act may survive its latest test, a case argued last month by Republican-leaning states seeking to challenge it.

The survival of the Affordable Care Act—combined with a gridlocked government—would make it unlikely that health-care policy will substantially change. That in turn, analysts said, will be advantageous for hospitals, which have benefited from greater volumes of insured patients.

“The [election] outcome probably is as good as we could have hoped,” said Whit Mayo, managing director of equity research at UBS. “The [chance] of seeing more coverage is probably greater than less coverage. And that’s almost always a good thing for everyone in health-care services.”

One of the biggest challenges for hospital systems in the months ahead will be the sharp climb in Covid-19 cases, which public-health officials expect will worsen in the coming weeks as more Americans test positive after traveling for Thanksgiving. The U.S. reported more than 135,000 new coronavirus infections Sunday, according to the Covid Tracking Project, and hospitalizations surged to more than 93,000—a new record.

The jump in cases threatens to overtax hospital systems again. But this time, investors and analysts expect hospital systems to better weather the Covid-19 influx, thanks to a deeper understanding of how to treat the virus and how to manage hospital capacity. And unlike this spring, when states across the country imposed restrictions on elective procedures, analysts anticipate that local governments will instead leave those decisions to hospital systems.

Already, many hospitals seem more willing to push ahead with the profitable procedures that hospitals routinely conduct, especially after many systems have enjoyed a faster-than-expected rebound in hospital visits for non-coronavirus patients. That—along with cutting expenses, including via furloughs and reducing salaries at some companies—has helped turn around hospitals’ financial landscape.

Federal assistance earlier this year, including $175 billion in direct aid approved by Congress for health-care providers across the U.S., has also delivered relief.

“I do think investors are becoming comfortable with the fact that hospitals can operate in a Covid environment and that everything doesn’t have to go into a complete shutdown,” said Frank Morgan, a research analyst at RBC Capital Markets.

Sanford Health, the largest health-care system in the Dakotas, said it could see more than 200 additional hospital beds filled in the weeks following Thanksgiving if people gathered in large groups to celebrate the holiday. Photo: Bing Guan/Reuters[object Object]

Still, even with vaccine optimism, some analysts note that the Covid-19 landscape could shift sharply if outbreaks significantly worsen in the coming weeks. Some nonprofit hospitals have begun putting elective surgeries on pause, and health-care workers are anxious about what could be a sustained influx of patients after already enduring an unrelenting year.

Even so, investor sentiment on hospital companies and the overall health-care sector remains positive. In its latest survey released in November, Bank of America said that health care remains the most overweight sector among fund managers.

Recent options activity, meanwhile, has indicated that investors became increasingly bullish on HCA and Universal Health in November, compared with the month before, said Michael Khouw, chief investment officer of Optimize Advisors. Activity in the options market implies that, on average, traders expect a nearly 7% increase in share price for HCA by mid-March and an almost 12% increase for Universal Health by mid-April, according to his data analysis.

Write to Caitlin McCabe at caitlin.mccabe@wsj.com