The stock market is unpredictable. It is also highly cyclical and dependent on investor behaviors. That doesn't necessarily mean you shouldn't invest in stocks, but it does mean you shouldn't try to time the market. Stock prices fluctuate. Trying to time the market just complicates your investing strategy. It also increases the chances that you end up missing out on potential gains for your portfolio.

The good news is that the stock market has a marked tendency to grow over time, regardless of short-term volatility and outright bearish periods. If you consistently put your cash into quality businesses regardless of the broader market, you stand to benefit from the market's highs as the years go by.

For long-term investors (those who buy with the intent of holding for a minimum of five years), it's always a good time to buy great companies. Here are two fantastic businesses that could drive market-beating returns in the years ahead, and are likely to crush the market in 2024.

1. Vertex Pharmaceuticals

Vertex Pharmaceuticals (VRTX -0.06%) has had a series of amazing years, with profits, revenue, and cash pouring in because of its successful franchise of cystic fibrosis medicines. Share prices are up 40% over the last year alone. It's the only company with approved drugs that treat the underlying cause of cystic fibrosis, a disease that affects over 160,000 people globally. There is a significant addressable market for the business, as these revolutionary medicines are helping people live better and longer.

Recently, management tallied its core addressable market (North America, Europe, and Australia) at about 92,000 people. The financial workhorse of its portfolio is Trikafta. That drug maintains patent exclusivity until 2037, and Vertex is rapidly advancing new potential blockbusters in its pipeline and portfolio that could stem a future patent cliff.

The company just gained approval for its landmark gene-editing therapy Casgevy, the first CRISPR therapy to be approved and a potential one-time functional cure for both sickle cell disease and transfusion-dependent beta thalassemia. The U.S., U.K., and European Union have given recent regulatory green lights to the drug, which Vertex co-developed and will co-market with CRISPR Therapeutics.

Another potential blockbuster that Vertex plans to seek final approvals on this year is its acute pain candidate VX-548. There are a wide range of potential use cases for this drug. It's not an opioid, so it could provide effective pain relief that goes beyond the abilities of an over-the-counter drug but stops short of the addictive potential of many current painkillers on the market. VX-548 has shown promise in multiple phase 3 trials in both safety and patient tolerance, across multiple types of acute pain, and in both surgical and non-surgical settings. In one study, for example, VX-548 helped patients achieve notable improvement in pain following surgery compared to the placebo.

Beyond this promising pain candidate, Vertex is working on other cystic fibrosis drugs. It's also working on treatments for diseases that currently have no available options to treat their underlying genetic causes, such as Duchenne muscular dystrophy and APOL1-mediated kidney disease. The company is even developing stem cell therapies for diabetes.

The future looks bright for this healthcare business, which is already coming from a position of strength. As mentioned, the stock price has risen significantly this past year, so it sells at a bit of a premium (Its price-to-earnings ratio is 30.8). But for long-term investors, its potential for further growth in the years ahead justifies the short-term premium.

2. Amazon

Amazon (AMZN 3.43%) stock has been somewhat volatile over the past four pandemic-influenced years. However, a series of cost-cutting measures in 2022 and 2023 have helped to right the ship for this tech giant, and its underlying group of core businesses has proven to be resilient even in an uncertain economy.

Most people know Amazon for its flagship e-commerce platform, and most of its top line is still tied to e-commerce-related sales. In 2023's Q4, $114 billion (67%) of Amazon's total $170 billion in net sales came from online stores or fees derived from third-party seller services available on its e-commerce platform.

Amazon's second-largest business driver is its cloud division. Net sales from Amazon Web Services (AWS) totaled $24 billion (14%) in Q4. However, AWS accounts for about 55% of the company's profits. AWS brought in $7.2 billion of Amazon's overall $13 billion in operating income in Q4.

Another segment that is increasingly proving to be a powerhouse for the company is Amazon's somewhat less discussed advertising business. In Q4, Amazon's advertising revenue was roughly $14.6 billion (8.5%). While that advertising business is small compared to its e-commerce and cloud segments, it's still sizeable, it's growing quicker, and it has much better profit margins. It's also gaining market share of the broader advertising market. According to Statista, Amazon now accounts for 13% of total net digital ad revenue in the U.S., which is the world's largest advertising market, and 10% of all ad spending globally.

Shares of Amazon are trading up by roughly 70% over the last 12 months, as investors have reaffirmed their interest in the stock. Despite that huge runup, the stock still trades at a price-to-sales ratio of 3.2, which is in line with its 10-year average. And yet, over those 10 years, the stock price has risen 907%.

Regardless of what happens with the stock market in the coming weeks or months, this is a business that has dealt with its fair share of economic ebb and flow. Amazon continues to prove itself as a business that is primed to stand the test of time. That's the kind of stock you want to buy, add to, and hold on to for the long run.