Gilead Sciences' (NASDAQ:GILD) share repurchases last year could only be classified as horrible: The company bought back shares between $83.33 and $100 per share as the stock dropped precipitously, ending the year in the low $70s.

This year, however, management has done a much better job, with the biotech paying an average of $69.50 per share for the 10 million shares it repurchased through the first half of the year. As of Tuesday's close, that's a solid 21.6% return. There's no way Gilead is getting that kind of return leaving its cash in the bank.

Of course, unless Gilead reissues and sells the shares through a secondary offering, it's an unrealized gain for the company. The cash is gone, but in exchange, Gilead has a lower share count, which raises the company's earnings per share, a metric many investors use to value companies. Even investors who use free cash flow to value companies will see improved valuation with the lower share count since the price-to-free-cash-flow calculation takes the number of shares into account.

The lower share count also reduces the amount of cash Gilead has to pay in dividends. Essentially the biotech gets a return on the money it spent on share repurchases equal to the dividend yield, which currently sits at 2.4%. That's not the world's best return, but probably as good as or better than the yield Gilead can get on U.S. Treasuries or other safe investments it would buy otherwise.

Pen and magnifying glass on top of a paper copy of a balance sheet

Image source: Getty Images.

Of course, there are alternatives

While this year's share repurchases have been a positive in the short term, using the cash to license or buy additional drugs could have a bigger effect on Gilead's long-term valuation. Replacing the revenue lost from falling hepatitis C drug sales should be a bigger priority than boosting earnings per share by reducing the share count.

Gilead's purchase of Kite Pharma (NASDAQ: KITE) is certainly a good start. The acquisition adds Kite's chimeric antigen receptor T-cell (CAR-T) technology, including its lead cancer drug, axicabtagene ciloleucel, which is under review by the U.S. Food and Drug Administration.

But the $11.9 billion price tag still leaves Gilead with plenty of cash to make an additional purchase or two; it ended the second quarter with $36.6 billion of cash, cash equivalents, and marketable securities.

Gilead could add another cancer drug, but it might be better to buy or license a drug for nonalcoholic steatohepatitis (NASH), a liver disease with a growing affected population and limited treatment options. Gilead has a few drugs it's testing for NASH, but it seems likely that combining drugs that work on multiple pathways could work better than a monotherapy, much like Gilead has created cocktail treatments for HIV and hepatitis C.

Both, please

Even though buying near the bottom of the share-price dip has worked out well so far, I like that Gilead has slowed the pace of share repurchases compared to last year. Continuing purchases at this pace, even at higher prices than in the first half of the year, will end up being a good move if the stock price continues its turnaround into next year and beyond.

Gilead still has $8.3 billion remaining under its current repurchase authorization from the board, which is about a third of what it had in the bank at the end of the second quarter, after subtracting out the cost to buy Kite Pharma. But keep in mind that Gilead is still generating plenty of free cash flow -- $6.2 billion in the first half of 2017 -- which it can use to fund share repurchases and its dividend while still adding cash to the coffers to make additional purchases or licensing deals.