Image source: Getty Images.

Merck (MRK 0.51%) and AbbVie (ABBV 0.18%) compete head-to-head in at least two prominent markets: hepatitis C and autoimmune diseases like rheumatoid arthritis and psoriatic arthritis. AbbVie is still winning in the former category for now and dominates in the latter. But which of these two stocks has the upper hand over the long run? Here's how Merck and AbbVie stack up against each other.

Why buy Merck?

In the first half of this year, Merck grew earnings by an impressive 42% compared to the prior-year period. The drugmaker's stock is up 16% year to date, reflecting the strong earnings performance. That's not a compelling reason to buy Merck shares now, though. 

Merck faces some challenges with its current product lineup. Sales for top-selling diabetes drug Januvia/Janumet are growing, but only a little. Cardiovascular drug Zetia is performing better. Sales for cancer drug Keytruda and hepatitis C drug Zepatier are soaring. However, the overall growth from these products isn't enough to offset declining sales for other drugs like anti-inflammatory drug Remicade and respiratory drug Nasonex.

So why buy Merck? Its pipeline shows considerable promise. Keytruda was recently approved by European regulators as a second-line treatment for non-small cell lung cancer. That's another step toward reaching the $8 billion peak annual sales expected for the drug. Keytruda is also in phase 3 studies for treatment of bladder cancer, breast cancer, and multiple myeloma and in phase 2 studies targeting ovarian cancer, Hodgkin lymphoma, and other advanced solid tumors. 

In total, Merck's pipeline includes 21 phase 3 programs and 15 programs in phase 2. While Keytruda stands out as the candidate with the best prospects, Alzheimer's disease drug verubecestat could also be a huge winner if testing goes well. The drug is currently in a phase 3 clinical study.

Investors should also like Merck's dividend. The dividend yield currently stands at 2.96%, and Merck has a good track record of paying (and often increasing) dividends.

Why buy AbbVie?

AbbVie hasn't been a slouch at growing earnings, either. The biotech posted year-over-year earnings growth of 24% in the first half of 2016. Unlike Merck, however, AbbVie also grew revenue by an impressive rate.

Leading the way, as usual, was Humira. Sales for the autoimmune disease drug in the first six months of 2016 topped $7.2 billion, up 16% from the prior-year period. AbbVie's most sizzling growth, though, came from Imbruvica. Sales for the cancer drug in the first half of this year were over six times greater than in the same period in 2015. Hepatitis C drug Viekira is also doing quite well, with sales jumping 35% year over year to $833 million in the first six months of 2016.

Another newer drug should soon make a significant revenue impact for AbbVie. Empliciti, which won European approval for multiple myeloma in May as a combination therapy with Celgene's Revlimid, could reach peak annual sales of over $4 billion. 

AbbVie's pipeline also looks solid. The company has 15 phase 3 programs and 24 phase 2 programs. Standouts in AbbVie's pipeline include cancer drug veliparib and elagolix, which targets treatment of endometriosis and uterine fibroids.

If you liked Merck's dividend, then you'll love AbbVie's. The dividend yield is currently 3.79%. Since the company was formed in 2013, AbbVie has increased its dividend by more than 42%.

Better buy

Merck certainly has several things for investors to like, but I think the better buy between these two stocks is AbbVie. The company's current product lineup continues to show strong momentum. AbbVie's pipeline holds plenty of potential. And that dividend looks really attractive.

There is one big cloud on AbbVie's horizon: Sooner or later, Humira will face competition from biosimilars. However, I don't think that will happen for several more years, thanks to AbbVie's secondary patents on the drug. For now, AbbVie appears to be a good pick for investors looking for growth and income.