This story might sound familiar: Inflation is high. In response, the Federal Reserve raises interest rates multiple times. The stock market sinks. Ultimately, the U.S. economy enters a recession.

That's exactly what happened in the early 1980s. It's understandable that many are worried about a recession now with some of the same dynamics at play. But investors don't have to avoid stocks altogether. Here's my pick for the best stock to buy right now with recession fears rising.

A winner among lots of losers

Most stocks are performing dismally in the current environment -- but not all of them. Vertex Pharmaceuticals (VRTX 1.43%) has soared close to 30%, absolutely trouncing the S&P 500.

How has Vertex seemingly defied gravity? For one thing, the company continues to deliver strong financial results. For example, in the second quarter of 2022, Vertex's revenue jumped 22% year over year to $2.2 billion. Its Q2 earnings skyrocketed more than 12 times to $810 million.

This growth is due entirely to Vertex's cystic fibrosis (CF) drug Trikafta/Kaftrio. The company has three other CF drugs on the market, but they're losing market share to its newest and most powerful therapy. 

Vertex doesn't have to worry about external competition, though. There aren't any other approved therapies that treat the underlying cause of CF. Two potential rivals are evaluating CF candidates in phase 2 clinical studies. But even if they succeed in those trials, they have a long way to go before even having the opportunity to go head-to-head with Vertex.

Meanwhile, Vertex isn't resting on its laurels. The big biotech has yet another CF combination therapy in late-stage testing that could be even better than Trikafta. 

Importantly, Vertex really doesn't have to worry about any potential negative effect from an economic downturn. It's practically inflation-proof and recession-proof. No doctor will stop prescribing the company's therapies because of macroeconomic headwinds. No patient will stop taking Vertex's CF therapies. No payer will halt reimbursement.

An especially promising future

There's another reason why Vertex stock has risen so much this year. Investors recognize that the company should have an especially promising future beyond CF.

Vertex and CRISPR Therapeutics (CRSP 1.11%) expect to file for European approvals of exa-cel in treating the rare blood disorders sickle cell disease and transfusion-dependent beta-thalassemia by year-end. The two partners should be able to file for U.S. approvals in the same indications soon as well.

Exa-cel stands to be the first CRISPR gene-editing therapy to win regulatory approvals. It could also be Vertex's next blockbuster. And there are others potentially on the way as well.

Vertex's pipeline features two other non-CF programs in late-stage development. The company is evaluating inaxaplin as a treatment for APOL1-mediated kidney disease. This indication has a bigger patient population than CF does. It's also advancing VX-548 into a phase 3 clinical study in treating acute pain in the fourth quarter of 2022. VX-548 has tremendous potential as a non-opioid pain drug. 

We can't leave out Vertex's type 1 diabetes (T1D) program. Although the company is only in early stage testing of its lead candidate targeting T1D, it's optimistic about the prospects of success in developing a functional cure for the disease.

While these clinical programs move forward, Vertex should continue delivering solid growth with its CF drugs. The company's existing drugs currently treat a little over half of the 83,000 or so patients with CF. Vertex fully expects to increase its market share by securing additional reimbursement deals and winning approvals for younger ages. It's also working on new therapies that could treat the estimated 5,000 CF patients for whom the company's approved drugs can't help. 

The icing on the cake

There's one other plus for Vertex that's the icing on the cake: The stock's valuation. Vertex's shares currently trade at 18.5 times expected earnings. That might not seem especially attractive at first glance.

However, it's important to factor in Vertex's growth prospects. The stock's price-to-earnings growth (PEG) ratio is only 0.39. Granted, the projected growth could be jeopardized by pipeline setbacks. But with Vertex's strength in CF and several late-stage programs that are de-risked to some extent, I think it ranks as the best stock to buy right now for long-term investors.