PetMed Express (PETS -1.43%) and Zoetis (ZTS -0.45%) are two healthcare stocks for the dogs -- and the cats, too. PetMed Express is one of the largest pet pharmacies in the U.S., while Zoetis is a global leader in developing medicines and vaccines for pets and livestock.

Both stocks are performing very well so far in 2017. PetMed Express's share price has soared more than 60%. Zoetis stock is close to 15%, well above the S&P 500 index's gains. Here's why both PetMed Express and Zoetis should keep up their winning ways for investors.  

Medium-sized and small dog walking side by side on grass

Image source: Getty Images.

Delivering where it counts 

Both companies have brought smiles to the faces of shareholders in their quarterly updates this year. PetMed Express blew past revenue and earnings estimates in its fourth quarter ending March 31, 2017. The pet pharmacy enjoyed strong increases in new orders as well as reorders during the quarter. 

It was the same story for PetMed Express in the first quarter ending on June 30. The company again easily topped consensus revenue and earnings estimates. And its 41% year-over-year increase in profits in the first quarter was even better than in the previous quarter. 

Zoetis' growth hasn't been as impressive as PetMed's, but it's still been solid. The animal health company posted 17% earnings growth in the first quarter of 2017, followed by a 10% year-over-year earnings increase in the second quarter. 

PedMed Express and Zoetis also delivered in another way for shareholders -- through dividends. PetMed's dividend yield now stands at just over 2%, while Zoetis claims a smaller yield of 0.68%. However, with a super-low payout ratio of 23%, Zoetis appears to be in great shape for dividend hikes in the future.

Friendly trends

Several demographic trends should benefit both PetMed Express and Zoetis. Over the past decade, the number of households with pets grew at a faster rate than the overall number of households. This should continue into the future for multiple reasons.

For one thing, the number of U.S. households with more than one pet is growing. The two largest generations in U.S. history -- baby boomers and millennials -- both view pet ownership positively overall. Baby boomers are more likely than previous generations to have a pet, in part because of the greater recognition of the health benefits of older individuals owning pets. Research shows that millennials see owning pets as good practice for having a family.  

Zoetis should reap the rewards from trends outside the U.S. as well. Anticipated growth in the global population will almost certainly result in an increase in consumption of animal proteins. This should in turn drive higher demand for the anti-infectives, medicated feed additives, and other products that Zoetis supplies to the livestock industry. 

Also, large developing nations like China and India have expanding middle classes. Not only will these middle-class populations eat more pork, poultry, beef, and fish, but they will also be more likely to own pets. Zoetis wins on both counts. 

A few challenges

Both companies also face a few challenges, though. PetMed Express has been accused by short-seller Aurelius Value of marketing opioid drugs intended for animals in ways that appeal to humans addicted to opioid painkillers. Aurelius Value alleged that some addicts are even maiming their pets in order to obtain opioid drugs for themselves. 

PetMed denied the allegations and stated that it would report what it referred to as attempted stock manipulation by Aurelius Value to the appropriate regulatory authorities. The company stated that the two opioid drugs it sells, Tramadol and Gabapentin, are only dispensed with "valid prescriptions from veterinarians for the treatment of animals only." 

Zoetis isn't dealing with such serious allegations. However, the company faces the threat of more intense competition. Merck, in particular, seems to be on course to become a more formidable rival to Zoetis. In March, Merck Animal Health bought Vallee S.A., a leading producer of animal health products in Brazil.

Also, both PetMed Express and Zoetis have relatively high valuations. PetMed stock currently trades over 22 times expected earnings, while Zoetis trades at nearly 23 times expected earnings. Such lofty valuations could mean that any bump in the road would cause the stocks to fall pretty hard (like PetMed Express just did with the short-seller allegations).  

Barking up the right tree

Despite these challenges, I still like the prospects for both stocks. PetMed Express probably carries the greater risk. However, the company has taken the right steps in response to the recent allegations, in my view. PetMed came out with a strongly worded denial of the allegations and has asked Alphabet to remove all Google search engine ads for Tramadol and Gabapentin to avoid the appearance of marketing to opioid addicts. 

Assuming nothing further comes from the allegations by Aurelius Value, I think PetMed Express will rebound. Over the long run, my take is that the demographic trends mentioned earlier will drive both PetMed and Zoetis higher. These healthcare stocks may be for the dogs, but they're barking up the right tree for investors.