The S&P 500 and the Nasdaq Composite plunged into bear market territory last year as recession fears rippled through Wall Street. Both indexes are still deep in the red, but smart investors know two things: First, every past bear market has ended in a new bull market, meaning the next bull market is almost certainly on its way. Second, bear markets are an opportunity to buy great stocks at good prices.

The Trade Desk (TTD 4.15%) and Atlassian (TEAM 2.66%) have seen their share prices tumble 53% and 64%, respectively, from all-time highs and trading deep in bear market territory. But the future still looks bright for both businesses, creating an attractive buying opportunity. Here's why.

1. The Trade Desk

The Trade Desk operates the leading independent demand-side platform (DSP). Its software automates the media-buying process, enabling advertisers to run targeted campaigns across a variety of digital channels. While The Trade Desk undoubtedly faces tough competition from ad giants like Alphabet and Meta Platforms, it distinguished itself with superior technology and a more transparent business model.

Specifically, The Trade Desk's DSP features industry-leading artificial intelligence and the world's most advanced data marketplace, according to management. Both of those qualities result in better campaign outcomes for marketers. Additionally, as an independent ad tech company -- meaning it doesn't own any ad inventory and, therefore, has no reason to steer ad buyers toward specific content -- The Trade Desk offers more transparency than Alphabet and Meta Platforms, both of which have reason to steer ad buyers toward their own content (i.e., Google Search, YouTube, Facebook, and Instagram).

Additionally, Alphabet and Meta Platforms provide ad tech tools to marketers and publishers, meaning they service the buy-side and the sell-side of the ad industry. That creates yet another conflict of interest.

Meanwhile, The Trade Desk focuses exclusively on the buy side, meaning its values are better aligned with its customers. That quality helped the company keep its retention rate above 95% for the last eight years, and it has translated into market share gains over time.

In fact, CEO Jeff Green said The Trade Desk gained more market share in the third quarter than at any point in its history. Q3 revenue climbed 31% to $395 million, and non-GAAP earnings rose 44% to $0.26 per diluted share. Those results are particularly impressive because Alphabet grew revenue by just 6% in the same quarter, while Meta actually saw revenue decline by 4%.

Going forward, The Trade Desk is set to maintain its momentum. Global digital ad spend is expected to increase at 9.2% annually to reach $1.3 trillion by the end of the decade, and consulting specialist Quadrant Knowledge Solutions recently recognized The Trade Desk as a leader in the ad tech industry, citing a higher degree of technological excellence compared to other vendors.

Currently, shares trade at 17.3 times sales, a discount to the three-year average of 30.4 times sales. That's why this growth stock is worth buying today.

2. Atlassian

Atlassian specializes in team collaboration and productivity software. Its portfolio includes solutions for work management, IT service management, and enterprise planning, and the company is best known for its Jira suite. One of the most noteworthy things about Atlassian is its go-to-market strategy. Whereas most vendors rely on traditional marketing and direct sales teams, Atlassian primarily sells its products through self-service channels, and it relies heavily on word-of-mouth marketing. That approach has allowed the company to spend more money on product development, and the results speak for themselves.

In 2021, Forrester Research recognized Atlassian as a leader in enterprise service management, citing a stronger growth strategy than any other company. In 2022, research company Gartner named Atlassian a leader in enterprise-agile planning tools. More recently, software research specialist G2 recognized Atlassian as a leader in product management, bug tracking, and knowledge management. In fact, G2 named Atlassian the seventh-best global software seller in any category last year, a distinction that reflects high user satisfaction scores and a strong presence in several markets.

Building on that, Atlassian offers a broad range of solutions through a single platform, unifying technical teams in IT, engineering, and operations with non-technical teams in marketing, human resources, and finance. No other vendor provides that convenience. Additionally, Atlassian provides multiple work management products (e.g., Jira Work Management, Trello, and Confluence) tailored to different use cases. That gives the company an edge over single-product vendors.

Atlassian reported mixed results in the most recent quarter. Revenue increased 31% to $807 million, and free cash flow climbed 31% to $76 million, but management noted that free users were converting to paid customers more slowly and that existing customers were adding new users more slowly. That trend will likely persist until economic conditions improve, and it will likely lead to slower growth in the coming quarters.

However, Atlassian remains well positioned to create value for shareholders in the long run. Management says its $29 billion total addressable market grew 14% annually, and the company has a compelling value proposition: Its products help businesses work and collaborate more effectively.

Shares currently trade at 13.9 times sales, a discount to the three-year average of 28.3 times sales. Investors should buy a small position in this growth stock.