One of the worst things about investing in stocks is that sometimes, a bad stock pick can go really bad and lose pretty much all of its value. But at the same time, one single great pick can make up for a lot of bad ones, and deliver huge -- and sometimes life-changing -- returns. And you don't have to make risky bets on penny stocks or unknown companies, either. Frankly, some of the best investments can be companies that already have big market share and a well-known brand when they go public. 

Three investments that have really paid off are Trex Company Inc (TREX -1.76%), Mastercard Inc (MA -0.64%), and Starbucks Corporation (SBUX -0.41%). Since May 31, 2008 (one decade before writing this article), Trex, Mastercard, and Starbucks have delivered total returns of 2,000%, 552%, and 610%, respectively. So, if you'd invested $7,000 combined into these three companies a decade ago, you'd have $73,775 today, including dividends. 

A man looks surprised as a model rocket he is holding starts to launch.

These three stocks have rocketed higher over the past decade. Image source: Getty Images.

Let's take a look at where these companies were 10 years ago, and more importantly today, where they could be a decade into the future. 

From troubled turnaround to market leader

A decade ago, Trex was close to being in trouble. The company, which has pioneered the wood-alternative decking industry, was dealing with what would turn into a multimillion-dollar losing class action lawsuit related to bad products. At the same time, prior management had taken on substantial debt in a failed attempt to expand the company, leaving it with an ugly balance sheet and bloated operating model just as the Financial Crisis hit and consumers stopped spending on major home improvement projects like outdoor decks. Over the next two years, sales would fall 19% as the economy struggled to rebound from the Great Recession. 

But anyone who invested in the company early in 2008 would likely have done so based on the potential for a turnaround of the business under Ron Kaplan, who had just taken the reins as CEO and rebuilt the executive team, including bringing Jim Cline -- who took over as CEO in 2015 when Kaplan retired -- as his CFO. 

Within a couple of years, Kaplan and his new team would have Trex on the right path. The company settled the class action claim in 2010; made significant improvements in its cost structure, including reducing its long-term debt and streamlining its manufacturing; and increased its investments in product development. 

Fast-forward to today, and Trex's once-tarnished image has recovered, and it has become by far the dominant brand in its category. Nearly half of all wood-alternative decking sold in North America has the Trex logo on it, and the company regularly wins awards for quality and innovation. 

Pie chart showing wood holds 84% of decking market versus 16% for wood-alternative products like Trex.

Image source: Trex.

And there's plenty of growth yet to come. Regular wood still makes up more than 80% of decking volume sold each year, so there is a a huge amount of room to continue growing sales much higher. Taking another 10% in market share from wood would nearly double Trex's sales. And that would give it -- still -- less than 20% of the total decking market in North America. 

A key cog in the future of money

While Mastercard was far from troubled in 2008, it's important to remember that the financial world was in turmoil. The credit card and payments processor's earnings and cash flows would fall sharply during the financial crisis, and at one point in early 2008, its stock price was down more 60% from the pre-crash peak. In May of that year, it was still down 45%. 

But for investors willing and able to look past the short-term panic and fear the Global Financial Crisis was creating, Mastercard represented a remarkable value -- and a stellar opportunity to invest in the major global shift away from cash. And for anyone who took on the risk that the Great Recession would turn into a second Great Depression that even strong companies like Mastercard wouldn't be able to survive, it has paid off immensely. 

Smartphone user paying with Mastercard on a smartphone.

Image source: Mastercard.

The future looks great for Mastercard. Revenue and earnings continue to grow at very high rates -- up 31% and 49% last quarter -- as the company expands its geographical reach while also adding more and more capabilities to its already broad portfolio. 

And it's delivering these results with cash still making up the vast majority of global transactions, though the trend is steadily shifting to electronic payments. 

Lastly, Mastercard is in an especially powerful position as a well-known brand among consumers, merchants, and financial partners, no matter whether it's credit, debit, money transfer, or other niche payment services. As the globe steadily moves away from cash and the global middle class expands the adoption of credit, few companies are as well-positioned to profit as Mastercard. 

Getting its domestic house in order and going global

In a similar -- but different -- twist to Trex, Starbucks was under new (well, sort of new) leadership 10 years ago, with Howard Schultz having come out of retirement to reassume control of the struggling company at the start of 2008. But while Trex had serious financial woes and was going to face substantial weakness from the housing market in the next couple of years, Starbucks was still financially strong, but it had become bloated and was struggling to differentiate itself from other morning coffee options. 

Schultz slowed the company's growth and refocused its efforts on building the Starbucks brand while fixing what had become a bloated cost structure. In the decade since, Starbucks has become a much stronger company and brand, and it has continued to expand on both a domestic and global basis. In the past decade, it has nearly doubled its global store count from 15,000 to over 28,000 at last count. 

Customers and baristas in Starbucks Shanghai Roastery.

Image source: Starbucks.

And while its growth in North America is starting to slow as its store count grows more saturated, the global opportunity remains very strong. China alone is set to drive major growth, as the company recently described. Starbucks plans to more than double its store count in China over the next five years and substantially expand its bottled beverage and packaged goods distribution outside of Starbucks stores. This is expected to triple sales and double operating income in China by 2022. At that pace, China is on track to become the company's biggest single market in less than a decade.

This growth story isn't over yet, and it's not too late for investors to profit with Starbucks.