An investor's primary job is buying stocks of quality companies -- the price paid to own them rarely matters much in the end. If you can find a great stock at a bargain price, however, so much the better.

Here's a closer look at three companies that have sold off recently even though they're stocks with bright futures. If you're looking for some new names, you might want to scoop these picks up before the sale ends.

Red tag sale sign hanging from a shelf in a store aisle.

Image source: Getty Images.

ViacomCBS

A little over a month ago, shares of ViacomCBS (PARA 2.91%) (PARA.A 2.35%) started a sell-off that would ultimately subtract more than 60% of March's record high price of just over $100 per share -- most of that plunge took just three days to manifest. Granted, the heroic triple-digit run-up from late last year left it vulnerable to profit-taking but not to the degree the stock suffered.

You may recall ViacomCBS was one of the names mixed up in Archegos Capital Management's recent (and highly publicized) margin call. Rather than the fund adding more cash to its accounts, the investment banks serving as Archegos' broker sold the fund's sizable position in ViacomCBS to reestablish the minimum requirements of a margin-worthy brokerage account.

Here's the odd part: While such artificially induced price swings tend to correct themselves a few days later (once the market has time to process what's happened), this one hasn't yet. Shares of ViacomCBS remain near their early 2021 lows where they're arguably undervalued.

While it's smack-dab in the middle of the struggling cable television business, it's not just a TV name. Its recently rebranded streaming subscription product, Paramount+, accounts for the bulk of the 30 million customers the company reports among its entire suite of streaming services and is en route to a target of around 70 million streaming customers by 2024.

And that's just paid subscriptions. The media company is doing well on the ad-supported front too. Pluto TV currently sports 43 million regular viewers, but ViacomCBS expects that crowd to grow to more than 100 million people before the end of 2024. By then, its streaming revenue overall should be on the order of $7 billion.

In this light, the forward-looking price-to-earnings ratio of 10 doesn't read as "cheap" but rather "undervalued."

Penn National Gaming

Obviously, the pandemic wreaked havoc on the casino industry, but not all casino operators were equally upended by the coronavirus-related shutdowns. Penn National Gaming (PENN 2.95%) made lemonade out of lemons by leveraging its relationship with DraftKings and its stake in the Barstool Sports brand -- at least once major sports events resumed.

That didn't prevent last year's revenue from dropping by a third, driving the company deep into the red as a result. The dynamic of 2020, however, did highlight the potential of what's currently a highly fragmented and inefficient sports-betting market that made lots of regulatory progress during the year. The big year -- despite the sales setback -- was topped off by Standard & Poor's decision to add Penn National Gaming to the S&P 500 index in March.

Then, disaster. After rallying from its March 2020 low near $4 to a high of $142 one year later, Penn National stock is now trading at about $93 per share, down 35% from its peak.

Don't read too much into the downtrend, however. In retrospect, last month was an "as good as it gets" moment for the stock. The pullback in the meantime, however, is similarly overdone given this year's expected revenue growth of 40% followed by next year's projected top line growth of nearly 12%. That's going to be more than enough to bring the company back well into the black.

Enphase Energy

Finally, after a 36% sell-off from its year-to-date high, add Enphase Energy (ENPH 2.69%) to your list of stocks you can buy on sale.

It's probably the least familiar name on this list, but its industry is well known. Enphase makes solar power panels and bolsters its reach by offering the software and support needed by installers and end users.

Despite the logistical challenges the pandemic created for a bunch of other industries, solar power shrugged them off. The Solar Energy Industries Alliance and analytics firm Wood Mackenzie estimate 19.2 gigawatts of solar power production capacity was installed in 2020, up 43% from 2019 levels thanks to a particularly strong fourth quarter. Wood Mackenzie forecasts the installation of another 324 gigawatts of capacity in the U.S. over the course of the coming 10 years. The rest of the world is moving at a similar pace.

It's not like investors didn't connect the dots. Following their modest pullback early last year when the coronavirus first made landfall in the United States, shares of Enphase Energy soared more than 800% from trough to peak. The recent weakness is mostly profit-taking, triggered by the company's decision to raise more than $1 billion by issuing new debt.

Think bigger picture, though. While the stock's not cheap by any means, this year's expected sales growth of nearly 74% puts the company on pace to more than double 2020's per-share earnings in 2022.

Solar power is having a moment.