It's a tough year in the markets when even a 10% decline would mean that your investment is outperforming the S&P 500, which has fallen a staggering 22% thus far. Having a market-beating stock in your portfolio might still mean you're in the red.

But two stocks that are generating positive gains and vastly outperforming the stock market right now are Vertex Pharmaceuticals (VRTX 1.36%) and T-Mobile US (TMUS 0.62%). These businesses have proven to be unstoppable this year, and below I'll look at what's been behind their strong performances.

1. Vertex Pharmaceuticals

Biotech company Vertex Pharmaceuticals is a top name in cystic fibrosis (CF), and that has been what's driving its sales growth today. Revenue from Trikafta/Kaftrio has generated nearly $3.7 billion in revenue over the first two quarters of 2022 and accounted for the bulk of the company's sales, which totaled $4.3 billion during that time frame. The blockbuster drug has also grown at a rate of 49% from the prior-year period.

But Vertex has been diversifying outside of just CF and has been working with CRISPR Therapeutics on developing a gene-editing therapy, exa-cel, for rare blood disorders. The treatment has the potential to be a blockbuster and generate billions in annual revenue at its peak. Last month, Vertex said it planned to submit a biologics licensing application for exa-cel to the Food and Drug Administration for a rolling review that will begin as early as November and will be complete early next year.

Shares of Vertex have soared 35% this year, eclipsing the S&P 500. Vertex is a monster stock that growth-oriented investors have been piling money into this year. Approval of exa-cel could lead to even more gains in the future. 

The healthcare stock currently trades at 24 times its trailing earnings, which is a bit more expensive than the industry average of 20. But given that it could be on the cusp of another exciting growth opportunity, it's easy to see why a premium for Vertex may be justifiable. 

Despite the gains thus far, it may still not be too late to load up on Vertex as the stock still has the potential to soar higher.

2. T-Mobile US

At 110 million customers, T-Mobile is among the leading telecom company in the country. Unlike rival stocks AT&T and Verizon, which pay dividends, T-Mobile doesn't offer a payout but instead has focused on customer satisfaction and upgrading its network. And thus far, it's been proving to be a winning formula.

In the most recent quarter, ended June 30, T-Mobile posted its best second-quarter numbers ever with customer additions reaching record highs. T-Mobile raised its guidance for the year and now expects net customer additions for its post-paid accounts (customers who pay at the end of the billing cycle) to top between 6 million and 6.3 million. Previously, the company was forecasting between 5.3 million and 5.8 million.

The company says that unlike its rivals, it won't raise the price of its plans for customers even as costs continue to rise. Meanwhile, T-Mobile has been focusing on developing a superior 5G network, with half of its customers now using 5G-enabled phones. T-Mobile's extended-range 5G network covers 97% of Americans.

T-Mobile is still trimming its business and is incurring merger-related costs (it merged with Sprint in 2020), and its bottom line is in the red. But its core adjusted earnings before interest, taxes, depreciation, and amortization (EBITDA), which excludes lease revenue from device-related financing programs, was $6.6 billion in Q2 and rose 10%.

Year to date, shares of T-Mobile are up 15%, and with more growth potentially on the way through additional price-conscious customers, the stock could rise even higher. Its price-to-earnings multiple of 96 may look scary, but based on its estimated future profits, it's only trading at a multiple of 18, which is only slightly higher than the S&P 500 average of 16.

Overall, this could make for a solid growth stock to own as T-Mobile's focus on winning over customers and keeping prices constant could help it perform well amid inflation.