There's arguably no better time to buy a stock than when it's been beaten down. Doing so provides a reasonable entry point for investors willing to hold the stock for a while, which can translate to outsized returns in time. Of course, not every stock lagging the market is worth an investment. It's essential to ensure a company has the tools to recover from whatever slump it is going through before taking that step.

Finding beaten-down stocks worth buying in a bull market can be difficult, but it's not impossible. Here are two examples: Fiverr International (FVRR 3.74%) and Moderna (MRNA 1.69%). These two struggling companies are down by 36% and 43% in the past 12 months, respectively. But they can still deliver excellent returns in the next decade.

1. Fiverr International

Fiverr's platform helps connect freelancers to businesses that need their services. The company's name comes from the starting price, $5, for the jobs on its website. It also points to one reason Fiverr has been successful: Businesses can hire talented freelancers, who are relatively cheap, to complete specific jobs. That beats having to go through the process of onboarding employees who are eligible for all sorts of benefits, a much more expensive proposition.

Still, Fiverr's business slowed down in the past couple of years. Its pandemic-related tailwind ended, economic challenges hit, and revenue growth dropped. In the third quarter, Fiverr's top line of $92.5 million increased by 12.1% year over year:

FVRR Revenue (Quarterly YoY Growth) Chart

FVRR Revenue (Quarterly YoY Growth) data by YCharts.

On the bright side, Fiverr turned in net earnings per share of $0.07, much better than the net loss per share of $0.31 reported in the third quarter of 2022. The company aggressively cut costs last year.

Becoming profitable is a good step in the right direction. And for that to last, Fiverr will have to grow its top line at a good clip. Fortunately, the company has a massive addressable market it estimates at $247 billion.

That's because the gig economy is growing fast, and the rest of the world is adapting. Companies such as Airbnb that provide travel arrangements are increasingly accommodating long-term stays (28 days or more), which are growing in part because of people traveling while working remotely. Fiverr competes with several companies in this field, including the larger Upwork. But even capturing a comparatively small percentage of its total addressable market would help revenue soar.

Fiverr generated $353 million over the trailing 12-month period. If the company can increase that total to $2.47 billion in 10 years, its revenue would clock in a compound annual growth rate of 21.5%. Given Fiverr's network effect, the tech company will likely remain a leader in this niche. Delivering above-average returns in the next decade is well within the company's reach.

2. Moderna

Moderna's revenue and earnings are dropping off a cliff: Sales of its coronavirus vaccine slowed down drastically.

MRNA Revenue (Quarterly) Chart

MRNA Revenue (Quarterly) data by YCharts.

But there is hope for the biotech. Moderna is currently awaiting approval for its respiratory syncytial virus mRNA-1345, in what could be the first of many non-coronavirus approvals.

Moderna has two other promising programs in late-stage studies. The first is mRNA-1647, a potential vaccine for cytomegalovirus (CMV). This virus is relatively harmless for healthy adults, although it can sometimes lead to complications, especially for those with weak immune systems. Another potential danger: CMV can cause birth defects in infants and is, therefore, a dangerous virus to contract during pregnancy. There are currently no CMV vaccines approved by the U.S. Food and Drug Administration.

Moderna is also developing mRNA-4157, a potential cancer vaccine. The biotech is testing it in a Phase 3 study in combination with Merck's Keytruda. Both vaccines could hit the market within the next three years. That could be the beginning of a long string of approvals, given the biotech's deep pipeline.

Moderna's phase 2 pipeline features more than half a dozen programs. There are many more in Phase 1 studies. In the next few years, expect the company to make significant clinical progress with these early stage programs.

But even before that, the biotech expects to return to top-line growth next year and to break even on the bottom line in 2026. In short, Moderna may be struggling right now, but it remains an attractive biotech stock to buy.