The S&P 500 has shown resilience in 2023, gaining 7% so far this year as investors have reacted positively to cooling inflation and look past the banking crisis that recently rocked the markets. Signs of a healthy jobs market could act as an additional tailwind along with a potential pause in the Federal Reserve's interest-rate increases.

As a result, it wouldn't be surprising to see the S&P 500 appreciate further in 2023. It's worth noting that the S&P 500's median returns in the six months after hitting a bear market low stand at an impressive 22.8% since 1925. The median 12-month gains after a bear market are even more impressive at 38%.

Two companies that investors may want to consider now are Twilio (TWLO 2.94%) and Chewy (CHWY -0.64%). Both are expected to deliver terrific gains, according to Wall Street analysts, and are trading at attractive valuations right now. Let's look at the reasons why.

1. Twilio

Cloud communications specialist Twilio is trading at an attractive 2.9 times sales right now, even after gaining nearly 22% so far this year. For comparison, the S&P 500 has a price-to-sales ratio of 2.4. Buying the stock at this valuation looks like a no-brainer for a few simple reasons.

Twilio is the dominant player in a market that's growing at a nice clip. The company generated $3.83 billion in revenue in 2022, a 35% increase over the prior year. For comparison, the global communications platform-as-a-service (CPaaS) market in which Twilio operates was worth $12.5 billion last year. That means Twilio controlled 30% of the CPaaS market in 2022.

The good part is that the CPaaS market is expected to clock annual growth of 29% through 2027 and generate $45 billion in annual revenue. If Twilio can maintain its share of this fast-growing space after five years, its top line could jump to $13.5 billion. Twilio, however, sees a much bigger total addressable market (TAM) in the future. The company estimates that its TAM could hit $116 billion in 2025 thanks to growing adoption of cloud-enabled customer engagement software and messaging applications.

Twilio itself expects to clock annual organic revenue growth of 15% to 25% in the medium term. At the same time, the company sees its non-GAAP gross margin increase in the range of 100 to 300 basis points annually. So it's not surprising to see that analysts are anticipating annual earnings growth of a whopping 102% from Twilio over the next five years.

And it won't be surprising to see Twilio deliver the impressive upside that Wall Street analysts are expecting from it. A consensus of 29 analysts covering Twilio give it a median price target of $83, which points toward a nearly 40% jump from current levels. The Street-high price target of $110 would translate into an 85% jump.

Given Twilio's cheap sales multiple and ability to grow at a solid pace in the long run, investors would do well to buy this cloud stock before the bull market arrives and inflates the valuation.

2. Chewy

Online pet-supplies retailer Chewy is another stock that investors can buy on the cheap right now. It's trading at just 1.5 times sales following a sharp pullback in the past couple of months after a solid start to the year.

The pullback may seem justified after Chewy saw a contraction in its customer base in fiscal 2022. But investors would do well to look at the bigger picture. Chewy finished fiscal 2022, which ended on Jan. 29, with a 13.6% gain in revenue to $10.1 billion, and the company's net margin increased by 130 basis points. Chewy posted adjusted earnings of $0.53 per share for the year compared with just $0.03 a year ago.

The company ended the year with 20.4 million active customers, slightly less than the 20.7 million customers it had at the end of 2021. However, a 15% year-over-year jump in the net sales per active customer to $495 helped Chewy record double-digit growth for the year, while also positively affecting the company's margins.

Chewy's existing base of active customers could continue to drive healthy growth in revenue and margin. Management pointed out in its quarterly shareholder letter that its three oldest customer cohorts spent over $1,000 on its platform last year. Its two most recent customer cohorts spent over $500 in 2022. Chewy also pointed out that with "nearly 60% of our customers having joined our platform within the last three years," it expects to see higher net spending per active customer over time.

This explains why Chewy sees its revenue growing between 10% and 12% in fiscal 2023. At the same time, the company expects to report an improvement in its active customer count in the current year. What's more, Chewy intends to enter its first international market in 2023 to improve its addressable opportunity.

So it won't be surprising to see an acceleration in Chewy's growth from this fiscal year, which could help the company hit Wall Street's price targets. According to a consensus of 23 analysts, Chewy has a median price target of $50 and a Street-high price target of $57, pointing toward a 42% and 62% upside from current levels.

In all, the online retailer's cheap valuation, its healthy customer base, and the steps it is taking to improve growth make it worth buying the bull market arrives and helps the stock regain its mojo.