With fear and uncertainty rocking the market, many stocks have taken a beating. However, smart investors know that these times are when money is made. High-quality stocks are being sold at depressed prices, and this can lead to some of the best investments to buy and hold for the long term. 

For savvy investors looking to make the most of this stock downturn, it might be wise to look at Doximity (DOCS -0.24%). This company is a top dog that balances stellar profitability and cash flows with impressive top-line expansion. Here's why Doximity might deserve a spot in your portfolio. 

Two healthcare workers shaking hands in a group.

Image source: Getty Images.

Doximity is the leader in its field

Commonly known as "the LinkedIn for doctors," Doximity helps healthcare professionals manage their careers. However, this analogy might be an understatement. Doximity's platform also enables healthcare professionals to communicate with patients and other medical professionals, learn about the newest medical research and practices, and conduct telehealth appointments.

This kind of platform is in high demand. Over 80% of U.S. physicians use the platform to manage their job and careers. This high saturation in the space drives significant network effects, potential allowing Doximity to remain the top dog for the long term. After all, if an incoming physician or other healthcare professional wants to connect with peers, Doximity is the best place to do so. The same goes for medical students looking to jump-start their careers, which is why 90% of U.S. medical students also use Doximity.

Doximity makes money primarily from pharmaceutical manufacturers looking to advertise their newest drugs as well as health systems looking to reach, hire, and recruit healthcare professionals.

As the leading platform, Doximity has attracted substantial marketing spending from these customers. In the company's fiscal 2022 year (ended March 31), revenue soared 66% year-over-year to $343.5 million. Importantly, management sees this continuing. In the company's fiscal 2023, it is expecting revenue of $456 million, which is a 33% year-over-year increase.

However, Doximity's profitability is what really impresses investors. In its fiscal year, the company generated $121 million in free cash flow and $155 million in net income -- representing margins of 35% and 45%, respectively.

But how much room does it have to run?

While Doximity's top-line projections tell a positive story, many investors are worried about how much Doximity can grow going forward. After all, there's less room to increase the number of users on the platform if the vast majority of healthcare professionals are already using it.

However, it's important to remember that Doximity makes its money based on advertising revenue from pharmaceutical manufacturers and health systems. On this front, there's still tons of room to improve. Doximity estimates that it has less than 5% of marketing budgets, signaling tremendous room for customers to increase their spending. Doximity believes its total opportunity is worth $18.5 billion, leaving it enormous room to flourish.

Some gray skies ahead

The other risk investors see ahead is the risk of a recession in the United States. Advertising is an easy place to cut spending, so if a recession were to hit, Doximity's customers could pull back on their marketing outlays.

While this is certainly something to monitor, Doximity might be more resilient than your traditional social media or advertising-based business. 73% of annual healthcare spending in the U.S. is determined by doctors. Considering the company has the vast majority of U.S. doctors using its platform, Doximity is becoming an invaluable place for pharmaceutical manufacturers and health systems to reach that core demographic.

Therefore, advertising on Doximity is necessary for many of these companies, which might be why 265 customers contribute at least $100,000 in annual revenue and 45 generate over $1 million annually. This would likely continue no matter the economic environment.

The last concern is the company's valuation. Doximity trades at 58 times free cash flow and 53 times earnings, which is expensive no matter how you slice it. This is a high-quality business deserving of a premium, but there is a risk of multiple compression.

Why Doximity is worth buying anyway

While the company's valuation might be expensive, the business looks appealing. Its wide-reaching dominance has allowed it to see adoption and deliver strong financial results, and its lucrative opportunity and robust network effects could help it stay that way.

The shares have dropped 27% year-to-date because of recession fears, but those might be overstated. With this noticeable price discount, it might be worth buying a few shares of this high-quality business.