Volatility has been on full display in the stock market this week. The wild swings are enough to cause many investors to look for safe havens to park their hard-earned cash. One option to consider is buying the stocks of drugmakers that generate dependable cash flow.

We asked three Motley Fool contributors to identify relatively safe pharma stocks to buy right now. Here's why those chose AbbVie (ABBV -0.85%), Gilead Sciences (GILD -2.40%), and Johnson & Johnson (JNJ -2.48%)

A person sitting in front of a laptop with hands held behind head.

Image source: Getty Images.

1. AbbVie: a rock-solid pharma giant at an attractive valuation

Prosper Junior Bakiny (AbbVie): Investors looking for safety in this volatile market can't go wrong with AbbVie. Like its peers in the pharmaceutical industry, it develops and markets lifesaving drugs that people need regardless of the state of the economy. Patients are unlikely to cut back on medicines even amid economic struggles. That's why AbbVie can continue generating decent revenue and earnings even during a recession. 

AbbVie's flagship product is rheumatoid arthritis (RA) treatment Humira. During the second quarter, Humira's total sales climbed by 4.8% year over year to $5.1 billion. That was despite the RA medicine seeing its international revenue drop due to biosimilar competition. Sales of Humira in the U.S. are still climbing, but with biosimilars set to enter the U.S. market in 2023, AbbVie will have to turn to other avenues for growth.

Fortunately, the company planned ahead. It currently boasts several products with fast-growing sales. During the second quarter, sales of immunosuppressant Skyrizi and RA treatment Rinvoq more than doubled compared to the year-ago period, while cancer medicines Imbruvica and Venclexta also saw solid year-over-year increases.

It's true that the FDA recently revised the boxed warning for Rinvoq to include increased risks of cardiovascular events, cancer, and death. Unsurprisingly, investors ran for the hills following this decision. However, the market's reaction was a bit overdone.

The RA drug represents a tiny portion of AbbVie's revenue base. And while the new boxed warning may negatively impact its sales, Rinvoq should continue to deliver decent revenue growth. AbbVie can also count on its Botox franchise to help sustain solid top- and bottom-line increases. Further, with 21 phase 3 clinical trials underway, expect new approvals and label expansions to regularly bolster the drugmaker's lineup.

As a bonus, AbbVie is a Dividend Aristocrat, making it an excellent choice for income-seeking investors. Historically, dividend stocks have outperformed their non-dividend peers. AbbVie's shares are currently trading for just 8.4 times forward earnings versus 14.5 for the pharma industry. This rock-solid pharma giant is a bargain at current levels.

2. Gilead Sciences: A blue chip pharma stock you can count on 

Zhiyuan Sun (Gilead Sciences): Gilead shares can be bought at an absolute bargain right now, trading at just 3.6 times forward revenue and 10.1 times forward earnings. That's much cheaper than the five times sales and 123 times earnings for the average pharma stock. What's more, you can also hold on to Gilead stock and receive a lucrative 3.91% dividend yield.

During the second quarter of 2021, Gilead's product sales increased by 21% year over year to $6.2 billion. Sales of its COVID-19 treatment Veklury drove a vast majority of its growth despite the traction gained by coronavirus vaccines. In addition, sales of Biktarvy, the No. 1 most prescribed HIV regimen in the U.S., increased by over $390 million. Approximately three out of four HIV patients in the country are prescribed antivirals from Gilead.

In other areas, the company anticipates it could generate over $1 billion in hepatitis B drug sales by next year, up from about $237 million per quarter right now. Gilead's hepatitis C virus franchise is also showing signs of recovery, with revenue up 23% year over year due to new patient starts. Furthermore, Gilead's cancer immunotherapy candidates have also gained traction, with sales up 39.4% year over year to $219 million.

But Gilead's momentum is far from over. The company's novel HIV drug, lenacapavir, is pending regulatory approval. The drug achieved 81% to 94% viral suppression rates when given to HIV patients in clinical studies. Recently, Gilead's immunotherapy Yescarta also achieved a 60% survival improvement compared to standard of care treatments in patients with large B-cell lymphoma.

Gilead also has 51 clinical-stage programs and 16 late-stage candidates in its pipeline. Overall, it's a cheap pharma stock with great growth catalysts that you don't want to miss.

3. Johnson & Johnson: As safe as they come  

Keith Speights (Johnson & Johnson): I can't think of a safer big pharma stock to buy than Johnson & Johnson. It's the biggest healthcare company in the world. J&J is a Dividend King with 59 consecutive years of dividend increases. And it has stood the test of time, surviving and thriving for 135 years. 

There are two key things that help make a stock a safer pick for investors. A diversified revenue base is important. So is financial flexibility to weather any storms that might arise and invest in future growth. Johnson & Johnson checks off both of these boxes.

The company's current lineup includes 28 platforms or products that pull in at least $1 billion in annual sales. Those platforms and products are spread across three major areas of healthcare: consumer health, medical devices, and pharmaceuticals.

Johnson & Johnson generated $82.6 billion in revenue last year. The consensus estimate is that it will make over $94 billion in 2021. The company's cash stockpile topped $24 billion as of July 4, 2021.

J&J's financial strength puts it in an exceptionally strong position to adapt to whatever twists and turns come up. The healthcare giant has certainly demonstrated its ability to innovate and make smart acquisitions. Close to 25% of its total sales come from products introduced in the last five years.

To be sure, no pharma stock -- or any kind of stock, for that matter -- is completely safe. But Johnson & Johnson is probably as close as you're going to get to that ideal.