Some economists predict a recession will hit within 12 months. While the stock market has been struggling for over a year, things could get worse for many corporations if we officially enter a recession. However, some businesses are built to handle almost any economic situation.

That's the case with pharmaceutical companies whose lifesaving medicines are in high demand even when the economy tanks. Let's look at two pharma giants that could help investors navigate the next recession and beyond: Bristol Myers Squibb (BMY -8.51%) and AstraZeneca (AZN 5.38%).

Chart showing the prices of Bristol Myers Squibb and AstraZeneca beating the S&P 500 in 2022.

BMY data by YCharts

1. Bristol Myers Squibb

Bristol Myers' top-line growth seems unimpressive right now. During the third quarter, the company's revenue declined by 3% year over year (YoY) to $11.2 billion. Even taking into consideration the negative effect of currency exchange fluctuations, the drugmaker's top line remained flat compared to the year-ago period. 

The company owes this negative performance to the loss of exclusivity of several products, especially cancer medicine Revlimid, one of its best-selling drugs. Generic competition is taking a bite out of Revlimid's sales, which came in at $2.4 billion for the period, 28% lower than the prior-year quarter.

Pharmaceutical companies routinely face patent cliffs. Bristol Myers is no exception. The key for the company is to replace older drugs with newer ones that won't run into generic competition anytime soon and can grow their sales for years. Bristol Myers is doing just that. The company has a portfolio of more than a handful of newer products, all of which earned the green light in 2019 or later. 

This lineup includes plaque psoriasis treatment Sotyktu, heart disease medicine Camzyos, and cancer treatment Opdualag, all of which first earned approval this year.

Bristol Myers' portfolio of newer medicines reported only $553 million in sales during Q3, up 61% year over year. But they will likely keep gaining ground.

Furthermore, some of Bristol Myers' older therapies are still performing well. Consider blood thinner Eliquis, whose sales in the third quarter jumped by 10% year over year to $2.7 billion. Or cancer medicine Opdivo, whose sales came in at $2.1 billion, 7% higher than in Q3 2021. Bristol Myers' revenue growth should increase in the coming quarters. And with more than 50 clinical compounds in its pipeline, it will earn many more approvals and label expansions.

Bristol Myers is also an excellent dividend stock, offering a yield of 2.83% and having raised its payouts by 35% in the past five years. The company even increased its dividends amid the pandemic. That's just one more reason why this pharma stock can handle any coming recession. And even if one doesn't happen soon, the company's shares are worth holding on to for years. 

2. AstraZeneca

AstraZeneca is firing on all cylinders. During Q3, the company's total revenue increased by 11% year over year (19% in constant currency terms) to about $11 billion. The biotech's adjusted earnings per share jumped by 55% to $1.67.

It's true that AstraZeneca is still benefiting from its July 2021 acquisition of rare disease expert Alexion Pharmaceuticals. But that hardly tells the whole story. Alexion contributed to AstraZeneca's financial results for a total of 92 days this quarter, compared to 72 days in the prior-year quarter -- a difference of a mere 20 days.

Further, some of AstraZeneca's best-performing units predate this transaction. Consider the company's oncology lineup. In Q3, AstraZeneca's product sales from this unit grew by 15% year over year to $3.8 billion. The company's cardiovascular, renal, and metabolism segment also reported product sales of $2.3 billion, 11% higher than the year-ago period.

AstraZeneca earned 19 regulatory approvals in major markets in the third quarter, many of which added indications to some of its best-performing products. One recent key approval for AstraZeneca was that of asthma medicine Tezspire, the rights to which it shares with Amgen. Tezspire first earned the green light in the U.S. in December 2021 and was approved in the European Union and Japan in Q3.

According to some projections, Tezspire could exceed $1 billion in sales by 2025, and it will only grow from there. It could become an important growth driver for AstraZeneca for years to come. The company's deep pipeline features 179 programs and includes 13 brand-new products in late-stage studies.

A handful of approvals every year, which the company is more than capable of accomplishing, can allow AstraZeneca to continue growing its revenue and earnings routinely even if the economy sinks into a recession.