NEW YORK- The coronavirus pandemic is throwing a spotlight on stocks in the U.S. healthcare sector, home to the companies that could develop treatments, vaccines and improved diagnostics needed to tackle the greatest public health crisis in a century.

Healthcare has held up better than most S&P 500 sectors. Since the S&P 500 hit an all-time high on Feb. 19, healthcare is down about 18% as of Wednesday, while the benchmark index has tumbled 27%.

The sector is typically considered a defensive area of the market because some investors believe consumers will continue buying healthcare products even during uncertain times.

Shares of pharmaceutical and biotechnology companies have led the pack, including those working on potential treatments and other ways to address the rapidly spreading outbreak.

In particular, shares of Regeneron Pharmaceuticals Inc and Gilead Sciences Inc have risen 24% and 8%, respectively, since the S&P hit its peak.

"A lot of these companies are working on a solution to the problem," said Walter Todd, chief investment officer with Greenwood Capital in South Carolina. "We can debate what it means to them ... monetarily, but perception-wise they are viewed as a safe haven because of that."

Greenwood Capital in recent weeks bought shares of Regeneron and Roche Holding AG, a Swiss company that has diagnostics and a potential therapy for the new coronavirus.

The purchases added to the firm's overweight position in healthcare, although it has pared its sector holdings during the recent outperformance, Todd said.

Healthcare lagged the market's big gains in 2019. Institutional investors generally held a lower weighting in healthcare relative to benchmark indexes before the pandemic took hold this year, said Rebecca Chesworth, senior equities strategist at State Street Global Advisors.

Healthcare "has been one of the most popular places to put money in the past couple of weeks,” she added.

The sector recently traded at 12.9 times forward 12-month earnings estimates, compared to 14 times for the overall S&P 500, according to Refinitiv Datastream.

Pharmaceutical and biotech stocks, including Eli Lilly and Co and Vertex Pharmaceuticals Inc, make up eight of the sector's top ten performers since Feb. 19, all of which have gained or fallen far less than the broader market.

“In general, if you are on a drug, you are staying on that drug," said Teresa McRoberts, a portfolio manager who focuses on healthcare at Fred Alger Management. "So that part of their business is pretty safe.”

Some areas of the sector have been hit hard by the vast ripple effects of the virus, particularly medical device companies dependent on elective procedures that are being delayed to preserve hospital capacity and resources for coronavirus patients. Shares of Zimmer Biomet Holdings and Stryker Corp, which make knee and hip replacements, are down 44% and 36%, respectively, since Feb 19.

Shares of hospital chain HCA Healthcare Inc have slumped 44% over that period as hospitals lose high-margin elective procedures and cope with severe disruption from the influx of coronavirus patients, said Jeff Jonas, healthcare portfolio manager with Gabelli Funds. 

Jonas, however, believes those areas could be quicker to recover than other parts of the economy when the pandemic recedes.

"You're going to be more nervous about getting on a plane, staying in a hotel, going out to dinner in the aftermath of this then you are about going back to see your doctor or to get a procedure done,” he said.

(Reporting by Lewis Krauskopf; Editing by Ira Iosebashvili and Bill Berkrot) ((lewis.krauskopf@thomsonreuters.com; 646-223-6082; Reuters Messaging: lewis.krauskopf.thomsonreuters.com@reuters.net, Twitter: @LKrauskopf))