The stock market has its ups and downs -- and if you stay invested for decades, you will likely experience your fair share of both bull and bear markets. At the same time, by investing in a diverse assortment of stocks across various industries, risk profiles, and business structures, you can watch your portfolio compound its growth through the years.

If you're on the hunt for great companies to buy and have $1,000 to invest, here are two names to consider for your portfolio.

1. Vertex Pharmaceuticals

Vertex Pharmaceuticals (VRTX -0.80%) is a top healthcare stock that has seen renewed investor interest of late, with shares trading up by approximately 35% over the trailing 12 months. The company has long been known for its multibillion-dollar cystic fibrosis drug franchise, and commands the market share in this space. This is because Vertex is the only company with drugs on the market that treat the underlying cause of cystic fibrosis.

The cystic fibrosis market was valued at around $12 billion in 2023, but some analysts think it could reach a valuation of around $137 billion by the year 2034. From this year to the end of that forecast period, you're looking at an estimated compound annual growth rate of around 25%.

Multiple factors are driving the expansion of this total addressable market. An increase in the cystic fibrosis patient population is one. The availability of more effective drugs like Vertex's that help patients live better and longer, therefore expanding the duration of demand for each drug for each patient, are also relevant factors. In the most recent quarter, Vertex's product revenue totaled $2.7 billion, a 13% increase from one year ago.

Currently, the biggest revenue driver for Vertex is its flagship cystic fibrosis medicine, Trikafta, which continues to gain approvals for younger cohorts of patients. Net income for the most recent three-month period totaled around $1.1 billion, a 57% increase from the year-ago period. Vertex closed the quarter with a hefty $15 billion of cash and investments on its balance sheet.

Vertex's new gene-editing therapy Casgevy, which is used to treat eligible patients with sickle cell disease (SCD) and transfusion-dependent beta thalassemia (TDT), has garnered a wave of approvals in recent months including by the U.S. Food and Drug Administration. The company co-developed the drug and shares marketing rights with CRISPR Therapeutics. It's estimated that Casgevy could reach blockbuster status before the end of the decade.

The process of administering Casgevy is lengthy and highly involved. It involves extracting cells from a patient, editing them to produce the proper amount of fetal hemoglobin, and infusing them back in. Patients must undergo a course of chemotherapy before the infusion can take place. Casgevy is intended to reduce or eliminate the terrible pain episodes called vaso-occlusive crises (VOCs) that SCD patients often experience, and enable TDT patients to forego transfusion requirements.

Vertex is in the early stages of seeking approval for a drug called suzetrigine, which is designed to be a non-opioid alternative for moderate to severe acute pain. The company also recently submitted regulatory applications for a new triple-combination therapy cystic fibrosis drug.

Management is planning to execute a series of product launches before the decade is out, and is well on its way to doing so. This profitable, fast-growing healthcare business might just be in the early innings of realizing its growth potential, and investors might want to join in.

2. Spotify

Spotify Technology (SPOT -0.50%) has had a bumpy few years, but the Swedish music streaming giant looks to be heading in the right direction. Its freemium model has always been a key growth driver, while also lending resilience in turbulent periods.

The company was not profitable in 2023, but it generated revenue of about 13.2 billion euros in the 12-month period. That figure was up about 13% from the full year 2022. Shares of the stock are trading up by around 70% from the start of 2024.

The macro environment and shifts in the global economy have impacted businesses across a range of sectors. Spotify has been one of them. At the end of 2023, it announced that it would be shaving 17% of its workforce in a series of cost-cutting maneuvers.

The other needle-mover here in terms of cost has been Spotify's own aggressive growth strategy. Management wants the company to hit 1 billion users by 2030, and $100 billion (or 93.5 billion euros) in annual revenue in the next decade. It's also been investing heavily into incorporating a wider selection of media on its platform, and expanding more into areas like audiobooks and podcasts.

To achieve these lofty goals, Spotify is going to need to keep costs on track while steadily growing its user base. In terms of user count, Spotify appears to be moving successfully toward its long-term goals. It closed out the first quarter of 2024 with 615 million monthly active users, with 239 million premium subscribers and 388 million utilizing the ad-supported tier. Those three figures represented increases of 19%, 14%, and 22% from the year-ago period.

Spotify generated 3.6 billion euros in revenue in the three-month time frame, a 20% increase from one year ago. Of that total, 3.3 billion euros were derived from premium subscriptions, while 389 million euros came from the ad-supported tier. Spotify's gross profit rose 31% from one year ago to around 1 billion euros. The company brought in 207 million euros in free cash flow and 211 million euros in cash flow from operations in the quarter.

Spotify is witnessing steady subscriber growth, and price increases on subscription plans have also moved the needle. In light of its roughly 32% share of the global streaming market, if you want to invest in the potential of this industry, Spotify looks like a good place to park some cash.