Explosive revenue growth proves athenahealth, Inc. (NASDAQ:ATHN) and Veeva Systems Inc. (NYSE:VEEV) can pull their target markets into the cloud fast enough to reward shareholders with impressive gains over the years. More recently, though, Veeva's sales have been accelerating while athenahealth's have begun tapering off.

Veeva's recent success is reflected in a gain of about 38.4% this year, while disappointing sales growth in recent quarters has left athenahealth's stock price relatively flat over the same time frame. Should investors chase the high flyer, or try to swoop in for a bargain? Let's look closer to see which stock is the better pick right now.

Person deciding whether to go left or right.

Image source: Getty Images.

The case for athenahealth, Inc.

At a time when medical back-office task automation seemed out of reach for all but the largest provider networks, athenahealth burst on the scene with affordable solutions for the little guy. Government incentives to implement electronic health-record systems provided an extra tailwind that sent sales and the stock price soaring.

Unfortunately, recent sales growth hasn't been as thrilling as in past years. The market hammered the stock after the company reported first-quarter results that showed revenue increased just 11.4% year over year.

Investors are especially concerned about the top-line slowdown because the company's operating margin has been squeezed paper thin in recent years. Now that the vast majority of U.S. physicians have electronic health-record systems, athenahealth must compete with bigger healthcare technology players on their home turf to continue growing.

ATHN Revenue (TTM) Chart

ATHN Revenue (TTM) data by YCharts.

A top line that's soared to $1.11 billion shows the company's solutions are gaining popularity. Unfortunately, gross profit rising slower than revenue suggests athenahealth must offer lower prices to compete with more established healthcare technology players.

The effects of competition also appear closer toward the bottom line. Sales, general, and administrative spending has finally tapered off, but increasing investment into research and development is taking a large bite. Investment should make athenahealth's products more competitive in the long run, but that's far from guaranteed.

Although margins are being squeezed at the moment, there are reasons to believe athenahealth's best days lie ahead. It generally charges a percentage of total transactions completed with its software instead of large recurring fees. In an increasingly unpredictable U.S. healthcare market, providers appreciate the flexibility.

The case for Veeva Systems Inc.

This company also owes its success to recognizing an underserved market. Several huge drugmakers, and plenty of smaller ones, were in dire need of the industry-specific customer relationship management (CRM) software Veeva. Providing the right solutions at the right time has made it the second-fastest software company to reach $500 million in annual revenue.

Among its 517 customers, you'll find the biotech giant Biogen, which uses Veeva's CRM tools to automate safety updates throughout its distributor network, and AstraZeneca, which claims the CRM helps its U.S. medical affairs team save 30% annually.

Drugmakers have been pounding a path to Veeva's door, driving annual revenue up 1,776% over the past seven years to $544 million during fiscal 2017, which ended January. Unlike athenahealth's case, recent growth has been strong on the top and bottom lines. During fiscal 2017, adjusted operating profit rose 47% over the previous year to reach $159 million.

As the proprietary Veeva Vault content management system (CMS) continues growing, it looks like more profits ahead. Portions of the company's commercial cloud CRM are built on the Salesforce1 platform, but Veeva owns the Veeva Vault CMS outright. Higher-margin CMS revenue reached an annualized $220 million run rate during the fiscal fourth quarter, and could soon be the company's largest revenue stream.

In the numbers

Unfortunately, Veeva's explosive growth has attracted enough attention to drive the stock to a lofty valuation. The stock, near its all-time high at the moment, has been trading at about 72 times this year's earnings estimates. Investors could realize big long-term gains if the company continues along its current growth trajectory. If this rocket levels off, though, it could lead to steep losses.

Although athenahealth stock has been beaten up recently, it still trades at about 60 times this year's earning estimates. If the company can widen its razor-thin margins in the years ahead, the stock could provide impressive gains.

While I'm optimistic about the future for both companies, I'd rather bet on Veeva's ability to maintain its growth trajectory than athenahealth's ability to widen margins going forward. That makes Veeva Systems the better stock pick right now.

This article represents the opinion of the writer, who may disagree with the “official” recommendation position of a Motley Fool premium advisory service. We’re motley! Questioning an investing thesis -- even one of our own -- helps us all think critically about investing and make decisions that help us become smarter, happier, and richer.