The stock market has been struggling all year, and before long, all three major U.S. indexes could find themselves in bear market territory. While that sounds unnerving, investors can seek refuge in the market by looking at those industries whose businesses remain somewhat stable regardless of market and economic conditions.

The healthcare sector fits the bill. Let's look at two healthcare giants worth serious consideration during market downturns: Medtronic (MDT 0.89%) and Merck (MRK -0.05%).

Surgeon in an operating room.

Image source: Getty Images.

1. Medtronic

Medtronic is one of the most prominent medical device specialists in the world. The company's portfolio boasts dozens of products across four major business segments: cardiovascular, neuroscience, diabetes, and medical surgical. Many of the company's devices are instrumental in helping physicians perform various medical procedures. Conditions that require surgeries can strike at any time and often without warning.

That's why Medtronic's business -- even if it isn't unscathed -- will remain somewhat in high demand in difficult times. It may be one of the reasons the healthcare giant has outperformed the broader market year to date.

MDT Chart

MDT data by YCharts

If things get worse and equities fall even harder, Medtronic is well-equipped to weather the storm since the company generates stable revenue, consistent profits, and positive free cash flow. During the third quarter of Medtronic's fiscal 2022, which ended on Jan. 28, the company reported revenue of $7.8 billion, which remained flat compared to the year-ago period.

On the bottom line, Medtronic's earnings per share rose by 17% year over year to $1.10. Medtronic's free cash flow for the nine months ended Jan. 28 came in at $4.3 billion, 22.5% higher than the year-ago period.

The company is still dealing with the negative impact of the COVID-19 pandemic. Medtronic said it expected procedure volumes in most of its markets to reach their pre-pandemic levels by the end of April, the end of its fiscal year.

There are two more reasons to buy Medtronic's shares. First, the company boasts multiple avenues for growth. Perhaps the most promising is its venture into the robotic-assisted surgery (RAS) market thanks to its Hugo System. While Intuitive Surgical currently dominates the RAS space, there remains plenty of white space to fill. Last year, Medtronic estimated that only 3% of surgeries were performed robotically. That's despite the benefits this method confers to patients (such as less bleeding, faster recovery times, and shorter hospital stays).

Second, Medtronic is part of the highly exclusive group of Dividend Aristocrats, having raised its payouts for 44 consecutive years. That makes it an excellent option for income-seeking investors as well. A strong dividend backed by a solid business may be what investors need in this volatile market. 

2. Merck

As a pharmaceutical company, Merck markets a raft of lifesaving medicines. These products also tend to remain in high demand regardless of economic conditions. People tend not to be too picky when it comes to taking drugs they need to stay healthy.

Merck's most important one is Keytruda, a medicine that has earned dozens of indications across various cancers. In addition, Keytruda is still on an upward path.

During the first quarter, Merck's revenue from its crown jewel grew 23% year over year to $4.8 billion. Some of Merck's other products performed well, too. For instance, HPV vaccines Gardasil and Gardasil 9 reported combined sales of $1.5 billion, 59% higher than the prior-year quarter. Merck's revenue from Lynparza -- which it markets with AstraZeneca -- increased by 20% year over year to $266 million.

Revenue from Lenvima, which Merck markets with Japan-based drugmaker Eisai, grew by 75% year over year to $227 million. Merck is also a leader in the animal health market, and the company's animal health revenue for the quarter increased by 4% year over year to $1.5 billion.

According to the research company EvaluatePharma, Keytruda will become the world's best-selling drug by 2026, racking up worldwide revenue of $26.9 billion. By comparison, Keytruda reported $17.2 billion in revenue last year. In other words, the cancer medicine will continue to contribute to Merck's top-line growth.

Elsewhere, the pharma giant can count on various other products in its lineup, as well as a rich pipeline with dozens of ongoing clinical trials that will yield regulatory wins in the coming years. The animal health sector is also on a growth path, something Merck will take advantage of with its expertise in this area.

Lastly, Merck is also worth considering for dividend-seeking investors. It may not be a Dividend Aristocrat, but it currently offers an above-average yield of 2.91% and a solid cash payout ratio of 53%. This healthcare stock is a great option when the market is struggling.