Very few investors will look back on 2022 fondly, with the S&P 500 average down 19.4% and the Dow Jones Industrial Average down 8.9%. Even healthcare stocks (which generally weather economic downturns well) are down this year, with the Fidelity MSCI Healthcare ETF down roughly 6.8% in 2022.

Some healthcare stocks, though, did manage to buck the downturn trend and are doing well despite the market doldrums. That doesn't guarantee they will continue to do well in 2023, but TransMedics Group (TMDX 0.42%), Vertex Pharmaceuticals (VRTX -0.76%), and AstraZeneca (AZN 5.38%) all have the pieces in place to continue their share gains into the new year.

Let's take a closer look at these three healthcare stocks defying the current bear market.

1. TransMedics Group delivers strong results

Shares for TransMedics Group rose 222% in 2022. The price jump was due in part to the company's financial performance and partly to its extended moat as the only organ transplant system approved by the Food and Drug Administration (FDA) to transport multiple organs.

Most organs harvested from donors go unused because they can only remain viable for a short time in cold storage. To combat this problem, TransMedics came up with its Organ Care System (OCS) that attempts to duplicate a functioning organ's environment, pumping it with warm, oxygenated, and nutrient-enriched blood to allow it to last longer so that it could be transplanted into a patient that desperately needs a new lung, heart, or liver.

The company said in its third-quarter report that it expects to make $80 million to $85 million in revenue in 2022, representing a jump of 164% to 181% over 2021. Those numbers seem to be accelerating. In the third quarter; it reported revenue of $25.7 million, up 378% year over year. The company is heavily invested in growth and developing its product, so it isn't profitable yet, but soon will be. In the third quarter, it had a gross margin of 71% and a loss of $7.4 million, down from a $13 million loss in the same quarter a year ago.

The company's system presents a radical change in how organs are preserved, with TransMedics providing end-to-end technology and clinical service by transporting the organs from the donor to the patient while ensuring the organ is kept viable with an OCS. What's exciting is that the company is the market leader in this technology, and its patents should give it an edge over competitors for years to come.

2. Vertex Pharma: Solid base, with more on the way

Vertex's shares were up 31.5% in 2022. The biotech company made the successful pivot from being a company that just focuses on cystic fibrosis (CF) therapies to one that is developing cell therapies to treat diabetes and rare transfusion-dependent blood diseases. 

Investors are excited about the company because of the huge potential of exa-cel, a therapy it is developing with CRISPR Therapeutics. The gene-editing therapy, in late-stage trials, was able to end the need for transfusions for patients with sickle cell disease (SCD) and beta-thalassemia. The company is in the process of submitting approvals for the therapy. Another potential blockbuster on the way is VX-880, which is a stem-cell-derived therapy in early trials to help diabetes patients produce their own insulin.

Vertex's third-quarter revenue, mostly from CF drugs Trikafta and Symdeko, was up 18% year over year to $2.33 billion. It also showed net income in the quarter of $930.5 million, or $3.59 in earnings per share, up more than 9% year over year. The company is scheduled to report fourth-quarter earnings after the market closes on Jan. 23.

AZN Chart

AZN data by YCharts

3. AstraZeneca's diverse portfolio driving revenue

AstraZeneca's shares rose more than 16% in 2022. That isn't as much as the prior two stocks, but it is a more mature pharmaceutical company with less volatility.

In the third quarter, AstraZeneca reported revenue, through nine months, of $33.1 billion, up 37% year over year and putting it on track for its fourth consecutive year of increased revenue. It also reported earnings per share (EPS) of $5.28, up 52% over the same period last year. The company's revenue from oncology drugs was particularly strong, up 33% year over year.

The company's cardiovascular, renal, and metabolism drugs also did well, with nine-month sales of $6.9 billion, up 22%, led by diabetes drug Farxiga, which now has had three consecutive quarters of sales of $1 billion or more. 

The company's big pipeline, with more than 179 programs, is paying off. It reported 19 approvals alone in the third quarter. A potential blockbuster drug is Enhertu, which has been recently approved for two different types of breast cancer and has FDA breakthrough therapy designations for another type of breast cancer, along with lung cancer and gastric cancers.

On top of that, AstraZeneca pays out a semiannual dividend, which currently has a yield of around 2.1%, a nice bonus to go along with a rising stock.