An estimated 36.7 million people around the world have HIV. Around 17 million of them are taking prescription drugs to treat their condition. The total global HIV drug market totals more than $20 billion annually. 

There are several choices for investing in HIV drug stocks. Three of the best options for long-term investors are Gilead Sciences (GILD 0.07%), GlaxoSmithKline (GSK -0.92%), and Merck (MRK 0.10%). Here's why these HIV drug stocks could be solid picks in 2017.

Pills and capsules on a surface that reads "HIV" and "AIDS."

Image source: Getty Images.

Gilead Sciences

Gilead Sciences claims the highest market share of any HIV drugmaker. The big biotech had eight HIV drugs combine for sales of more than $12.8 billion in 2016. Gilead's Truvada is the top-selling HIV drug in the world. 

A new HIV drug could be on the way soon from Gilead. The biotech is scheduled to wrap up a late-stage study of bictegravir in combination with F/TAF (Descovey) this year. Analysts project the drug could eventually reach peak annual sales of more than $5 billion. 

While Gilead's growth was due primarily to its HIV franchise for much of the company's history, in recent years its hepatitis C virus (HCV) drugs have made even more money. Last year, Gilead's HCV drugs combined to generate revenue of $14.8 billion. However, HCV sales are falling significantly, partially because of increased competition but resulting even more from lower patient starts, as the sickest HCV patients have been cured. 

The biotech's stock now trades at less than 9 times expected earnings. Many observers think Gilead will soon make one or more key acquisitions to help boost its bottom line. In the meantime, Gilead pays a dividend that currently yields 3.11%. This combination of low valuation, potential for growth through acquisitions, and strong dividend make Gilead Sciences an attractive option for long-term investors.

GlaxoSmithKline

GlaxoSmithKline's HIV drugs, Tivicay and Triumeq, combined for sales of nearly $3.4 billion in 2016. What's especially impressive about that amount is that it more than doubled the combined sales of the two drugs in 2015. 

HIV represents the fastest-growing market for GlaxoSmithKline's pharmaceuticals segment. However, the company continues to generate significant revenue from its respiratory-drug franchise. In addition, GlaxoSmithKline enjoys solid growth from its vaccines and consumer healthcare business units. 

GlaxoSmithKline awaits regulatory approval for several products, including the Shingrix shingles vaccine and rheumatoid arthritis drug sirukumab. The company's pipeline also features multiple promising HIV drugs in late-stage development, plus two respiratory-disease candidates and several experimental drugs for treating rare diseases. 

The company's growth prospects make GlaxoSmithKline's stock much more reasonably valued than its trailing-12-month earnings multiple of 91 indicates. Glaxo stock trades at less than 15 times expected earnings. In addition, the dividend currently yields 4.77%.  

Merck

Merck's sole HIV drug, Isentress, made sales of nearly $1.4 billion last year. However, that reflected a drop from the $1.5 billion in revenue for the drug in 2015.

The company hopes to rejuvenate its fortunes in the HIV market with experimental drug doravirine. Merck reported positive results from a late-stage study of the drug in February. Two other late-stage studies of doravirine are also in progress.

However, the biggest story for Merck these days centers on its wildly successful cancer drug, Keytruda. The drug generated sales of $1.4 billion last year, but that's practically a drop in the bucket for its potential. Analysts think Keytruda could reach peak annual sales of close to $8 billion. 

Merck stock trades at 15 times expected earnings. Its dividend yield stands at 2.95%.