It's been a tough year so far for investors. The S&P 500 is down a little more than 20% with most of that loss suffered during the second quarter. This, of course, means a good number of the S&P 500's constituents have fared even worse in that time frame, and the broad market itself certainly seems like it could lose even more ground before all is said and done.

There are a few stocks, however, that are not only beating the market, but seem to be thriving on its sweeping bearishness. Here's a closer look at three of them.

Monster Beverage

Monster Beverage (MNST -1.46%) makes and markets energy drinks. The Monster moniker is its flagship brand, though this is also the company behind NOS, Predator, Full Throttle, and a few other lines. However, the target market is largely the same for all its brands: consumers looking for a quick, caffeine-powered pick-me-up.

It's a surprisingly reliable growth market. Market research outfit Mordor Intelligence estimates the energy drink industry will grow at an average annual clip of just over 9% between now and 2027, approximately doubling in size during that span. Allied Market Research projects this business will reach yearly sales of more than $108 billion in 2031 versus 2020's $6 billion.

And Monster Beverage is clearly capturing at least its fair share of this business. Analysts are collectively calling for sales growth of nearly 16% this year to be followed by an 11% improvement next year. That should be enough to pump up per-share earnings from last year's $2.57 to an inflation-crimped $2.70 this year and to a whopping $3.21 per share next year -- a 25% increase over the two-year time frame. And that pace of growth simply extends the top-line growth rate for over a decade now.

Given Monster's track record, there's no reason to doubt the projections, or that the company will continue to ride the market's growth wave.

Monster stock won't come cheap, mind you. The shares are currently trading at 24 times this year's expected earnings and 20 times next year's likely bottom line; thank the investors who have pumped up the stock's price by 30% since March's low.But Monster Beverage is still a compelling buy at this premium price.

Dollar General

At first blush, it doesn't make much sense that a retailer could do well in the current environment of soaring inflation and the prospect of a recession. In fact, retail sales of general merchandise (not factoring in automobiles) were tepid in May and fell outright in April. Rock-bottom consumer confidence levels don't exactly scream "let's splurge" either.

When you really understand Dollar General's (DG 0.82%) business, though, the stock's 31% bounce back from May's bottom and the year-to-date gain of nearly 5% actually make a lot of sense.

That's because Dollar General caters to a cost-conscious crowd -- and most consumers have become much more cost-conscious just within the past few months. Smaller-sized packaging and a large assortment of private-label merchandise allow the retailer to deliver real value to its shoppers.

Adding to this value is where the bulk of its stores are found. Roughly three-fourths of its 18,000+ locales are in communities with populations below 20,000, where a Walmart isn't necessarily nearby. And the retailer's brick-and-mortar footprint puts at least one of its stores within five miles of 75% of U.S. residents. With the nation's average gasoline price still near $5 per gallon, a quick trip to a nearby Dollar General generates savings in and of itself. It is a big reason this fiscal year's sales are expected to be up 9%.

At a quick glance, the company's recent results wave a red flag. Last quarter's same-store sales slumped just a tad following a 1.4% contraction for the previous quarter. Don't read too much into just these numbers, though, as the comparison is being made to a pandemic-prompted, same-store sales surge. Last year's same-store sales were 13.5% higher than its pre-pandemic per-store revenue.

The company is forecasting net sales growth of 10% to 10.5% this year. It should be supported by new store openings and full-year, same-store sales growth of a more typical 3% to 3.5%. It's conceivable Dollar General could do even better than that if the economy simply slumps for a while without moving into a full-blown recession.

IBM

Finally, add IBM (IBM -0.89%) to the short list of stocks managing to move higher as the market moves lower. Shares now stand 17% above their late-February low and are knocking on the door of new 52-week highs.

Yes, this is the same IBM that was once a technology titan, but slipped into obscurity by not responding quickly enough to changes in the tech sector's landscape. Namely, the company missed the boat when it came to cloud computing, artificial intelligence, and cybersecurity, not addressing those opportunities in earnest until unveiling its so-called "Strategic Imperatives" initiative until 2014.

And even then, the company remained too focused on fading businesses like mainframes and managed infrastructure. Revenue peaked all the way back in 2012, and has been steadily declining ever since.

IBM, however, may have finally turned the corner. Now free of its legacy managed-infrastructure business and hyper-focused on hybrid cloud computing, lBM saw its top line rise a solid 8% last quarter. And don't assume that sizable leap is merely the result of an easy comparison to a coronavirus-crimped first quarter of 2021. For the same quarter a year earlier, sales were up 1% year over year. The company is coming out of the pandemic funk in better shape than it's been in years.

The analyst community thinks so, anyway. Building on the turnaround effort that's already bearing fruit, analysts are calling for full-year sales growth of a little more than 6% for 2022, and more than 3% growth next year. Because this top-line growth will largely stem from high-margin service and software revenue growth, profits are poised to improve at even faster clips of 22% and 7%, respectively.

Simply put, the turnaround plan is working, even if not everyone sees it yet.