Investors have been taken on quite the ride over the past 18 months. In less than a five-week stretch during the first quarter of 2020, the widely followed S&P 500 shed 34% of its value. Over the subsequent 17 months, the benchmark index has doubled in value. That's the fastest decline of at least 30% and the most robust bounce-back rally, all within 18 months.

More importantly, this wild ride demonstrates the significance of seeing your investment thesis play out over the long run. Although crashes and corrections are common, each and every notable decline throughout history has eventually been erased by a bull market rally. In other words, there's never a bad time to put your money to work in the stock market -- including when the index is near an all-time high.

If you have $600 ready to invest, which won't be needed to pay bills or cover an emergency, should one arise, the following trio of companies are some of the smartest stocks you can buy right now.

Hand holding a folded pile of cash bills.

Image source: Getty Images.

PubMatic

One high-growth trend investors would be wise to latch onto is cloud-based ad technology. Right now, small-cap PubMatic (PUBM -5.21%) looks to be the most attractively valued company in the programmatic ad-tech space.

Since the advent of the internet, the task of buying, selling, and optimizing ads has been moved out of the hands of humans. For more than two decades, this process has evolved. PubMatic is what's known as a sell-side platform for programmatic ads. In English, this just means its cloud-based ad infrastructure platform uses machine-learning algorithms to optimize the selling of ads for its clients (publishers).

Although humans aren't actually pricing ads any longer or matching up an ad with sellable display space (which is what PubMatic does), they can still offer inputs that give them control. For example, PubMatic's publishers can dictate a lowest acceptable price point that they'd take to sell their display space. Likewise, PubMatic aims to maximize the experience for content viewers by showing the most appropriate ad to a user, rather than the highest-priced ad.

If you're wondering how this strategy is working out for PubMatic, the results speak for themselves. In the second quarter, revenue rose 88% from the prior-year period, with dollar-based net retention of 150%. Put simply, we're talking about existing clients on the platform spending 50% more in the most recent quarter than they did in the comparable year-ago period. The company has also upped its full-year sales forecast for a second consecutive quarter.

PubMatic's management team views this growth as just the beginning. According to company presentations, cord-cutting should lead to sustainable double-digit growth in video, mobile, and connected TV/over-the-top programmatic ads through at least 2024. My suspicion is it'll last well beyond 2024. This makes PubMatic a no-brainer buy.

A lab technician using a pipette to fill a row of test tubes.

Image source: Getty Images.

Jazz Pharmaceuticals

Another smart company investors can scoop up right now with $600 is biotech stock Jazz Pharmaceuticals (JAZZ 0.30%).

Most biotech stocks aren't profitable, and they'll spend decades searching for their first blockbuster drug (i.e., one capable of $1 billion or more in annual sales). Following the recently completed acquisition of GW Pharmaceuticals, Jazz might now have two potential blockbusters in its portfolio.

However, this hasn't saved Jazz from being clobbered following the release of its second-quarter operating results more than three weeks ago. Whereas the company's sleep disorder franchise drugs have long been its growth driver, combined sales from Xyrem and Xywav rose by only 3% in the second quarter. This raised a few eyebrows and lopped more than 20% off Jazz's market cap. But as you're about to see, this negativity is unfounded.

For starters, Jazz looks to have secured its sleep disorder franchise cash flow for a long time to come with the development and approval of Xywav. This next-generation therapy contains 92% less sodium per dose than its predecessor, Xyrem, making it a safer option for patients with certain comorbid conditions, such as hypertension and cardiovascular disease.

Over time, Xywav should replace Xyrem, as well as add new indications to its label. My expectation is that the company's sleep disorder franchise could one day climb to $2 billion in annual sales, up from an expected annual run-rate of about $1.7 billion in 2021.

More importantly, GW Pharmaceuticals' Epidiolex is growing rapidly. GW Pharma's focus has long been on cannabinoid-based therapies. Its lead drug was approved to treat two rare types of childhood-onset epilepsy, as well as tuberous sclerosis complex, prior to being acquired by Jazz. The ability to expand Epidiolex's label, as well as grow organically, could allow it to eventually surpass $1 billion in annual sales.

What investors are getting with Jazz is a consistently profitable biotech company with rising sales that's valued at a little over 7 times Wall Street's profit forecast for 2022. That's value investors shouldn't pass up.

A veterinarian holding up a feisty small dog.

Image source: Getty Images.

Trupanion

A third smart stock to buy right now with $600 is companion animal health insurance company Trupanion (TRUP -5.22%).

Why Trupanion? Let's start by taking a closer look at pet industry spending metrics. According to the American Pet Products Association (APPA), an estimated $109.6 billion will be spent on pets in the U.S. this year. This includes over $32 billion in veterinary care and product sales. For some context, APPA data has shown that spending on companion animals hasn't declined on a year-over-year basis in at least a quarter of a century.

The pet industry may not be growing by a double-digit percentage, but it's about as recession-resistant as they come. More importantly, it demonstrates that pet owners will spend big bucks to ensure the happiness and well-being of their four-legged family members.

Similar to Jazz, Trupanion was put in time-out by Wall Street following its latest quarterly operating results. The company has lost in the neighborhood of a quarter of its value after reporting a wider loss, which was attributed to share-based compensation and acquisition-related expenses. Thankfully, this short-term pain could translate to long-term gains for patient investors.

You see, Trupanion has been building rapport within the veterinary community for the past two decades. It recently surpassed 1 million total enrolled pets and is generating a majority of its revenue from high-margin subscriptions. Having such a tight-knit relationship at the clinical level is a big reason Trupanion is consistently growing its enrolled pets and revenue by a double-digit percentage.

Trupanion also happens to be the only major pet insurance company that provides software to vet clinics to handle payment at the time of service. This makes the payment portion of the treatment process hassle-free.

Considering that Trupanion has only penetrated about 1% of the U.S. pet industry, its double-digit growth runway looks sustainable for a long time to come.