Imagine a stack of $1 bills that reached 5,377 miles into the sky. That's a lot of money. And it's how much cash just three big drugmakers together had as of the end of June 2018.

Gilead Sciences (GILD 0.07%), Amgen (AMGN -0.19%), and Johnson & Johnson (JNJ -0.69%) rank as the three top biopharmaceutical companies when it comes to cash stockpiles. Here's what these drugmakers are most likely to do with all that money -- and whether or not you should consider investing some of your hard-earned cash to buy their stocks.

Man in a boat made from money on a sea of cash

Image source: Getty Images.

1. Gilead Sciences

Gilead Sciences claims the most cash of any drugmaker. As of June 30, 2018, the big biotech reported cash, cash equivalents, and marketable securities totaling $31.7 billion. That was down from $32.1 billion at the end of the previous quarter.

The company generated $1.6 billion in operating cash flow in the second quarter. However, Gilead used most of that amount on tax-related payments. The biotech dipped into its cash reserves to pay its dividend and buy back shares. Gilead should be able to grow its cash stockpile, though, with continued strong cash flow provided by its HIV and hepatitis C virus (HCV) franchises.

Investors can probably count on Gilead to keep boosting its dividend in the future by around 10% annually, as it has since the company initiated the dividend program in 2015. However, I expect that Gilead won't use as much cash as it has in the past to repurchase shares.

I think that we'll see some acquisitions activity with Gilead in the near future. When asked about business development in the biotech's Q2 earnings conference call, CEO John Milligan said that "you'll see many things coming to fruition in the second half of this year." Even though Milligan is stepping down at the end of the year, he stated that his departure shouldn't slow down efforts to make deals.

2. Amgen

Another big biotech isn't too far behind Gilead. Amgen reported cash, cash equivalents, and marketable securities totaling nearly $29.4 billion as of the end of June. The company ended the first quarter with $32.2 billion.

Amgen spent $13.9 billion in the first half of 2018 buying back shares. It also used $1.8 billion to fund its dividend payouts. The biotech generated an impressive operating cash flow of $4.6 billion in Q2. However, Amgen could see some pressure as revenue from several of its top-selling products declines in the face of biosimilar competition.

This shouldn't present any problems for the company in keeping its dividend hikes coming, though. Amgen claims one of the best track records around for dividend increases, boosting its dividend by more than 180% over the last five years.

Amgen CEO Bob Bradway stated earlier this year that returning capital to shareholders through buybacks and dividends remains a top priority for the company. Bradway also hinted at the possibility of deals, saying that there is "potential for doing some attractive business development." So far this year, though, Amgen hasn't made any acquisitions -- probably because of the high valuations in the industry.

3. Johnson & Johnson

Johnson & Johnson ranks as the No. 1 healthcare company in the world by market cap, but it comes in at No. 3 based on cash stockpiles. The company reported cash, cash equivalents, and marketable securities of $18.1 billion as of the end of the second quarter.

J&J was very active in making acquisitions last year, spending $29.6 billion buying Swiss drugmaker Actelion. The company hasn't been totally quiet on the dealmaking front in 2018, but the transactions have been much smaller and focused on beefing up the medical device segment.

You can safely bet that Johnson & Johnson will continue allocating more cash to its dividend program: The company has increased its dividend for 56 consecutive years. J&J will also likely keep buying back shares. The healthcare giant also has a long-term debt of $29.4 billion and could use some of its cash to pay it down.

Are more acquisitions ahead for Johnson & Johnson on the pharmacy front? Possibly. The company's late-stage pipeline primarily consists of studies focused on picking up additional indications for already-approved drugs, including Darzalex, Imbruvica, and Tremfya. J&J could benefit from some "new blood" in its development program.

Are they buys?

Of these three stocks, I'm least bullish on Amgen right now. The biotech has a great new migraine drug, Aimovig, and several other rising stars. However, Amgen faces increasing headwinds for Enbrel, Neulasta, Aranesp, and Epogen. I think the company needs to spend some of its cash to buy assets to help offset revenue losses for these drugs. For now, my preference is to stay on the sidelines with this stock.

I'm not overly excited about Johnson & Johnson's growth prospects. However, J&J is a blue-chip stock that I see as a good addition to investors' portfolios because of its stability and dividend. Pretty much anytime is a good time to buy J&J, including now.

My favorite among these cash-rich drugmakers is Gilead Sciences. There are several great stories for Gilead right now, including stabilization for its HCV franchise, a powerful new HIV drug with Biktarvy, and a promising pipeline. The stock currently trades at 11 times expected earnings. I think that Gilead is a bargain that should pay off over the long run.