The stock market can move in any direction over a year, and it is difficult to predict which way it will go. But over more extended periods, say, a decade, equities tend to be northbound. That doesn't mean just any old company will do the trick for investors looking to earn solid gains over the next 10 years.

Picking the right stocks is an essential step. Let's look at two companies that could deliver solid returns through 2033 and beyond: Exact Sciences (EXAS 0.10%) and Pinterest (PINS 4.04%). If you have $500 you aren't saving for emergencies or routine expenses, here is why putting that money to work by investing in these stocks could be an excellent move.

1. Exact Sciences

Exact Sciences' mission is to fight cancer. The company's approach has been to develop non-invasive diagnostic tests that can detect some forms of the disease relatively early. Most notably, Exact Sciences markets Cologuard, a colorectal (colon and rectal) cancer test. Cologuard has been one of the keys to Exact Sciences' success, and with good reason.

Medical authorities typically recommend that those who are 45 and older and are at average risk of contracting colorectal cancer (that is, they have no family history of the disease or other factor that increases their risk) get tested regularly. There is plenty of evidence that this isn't happening yet at a large enough scale. Colorectal cancer is the second-leading cause of cancer death in the U.S., despite being highly treatable when caught early. In other words, not enough people are being diagnosed before it has metastasized.

That's where Cologuard comes in. Since its launch in 2014, Exact Sciences has screened millions of people, but the company still estimates that there are 60 million patients who aren't up to date with the recommended screening schedule. So there is plenty of work to be done that should translate to solid revenue growth, which Exact Sciences is already displaying.

In the first quarter, the company's top line jumped by 24% year over year to $602 million. However, Exact Sciences isn't profitable yet. Its net loss per share of $0.42 was much better than the loss per share of $1.04 it reported in Q1 2022. Exact Sciences' long runway for growth in screening colorectal cancer will help it achieve profitability, as will the other exciting opportunities at its disposal. The company's other products include Oncotype DX, which helps predict the risk of recurrence in breast cancer patients. It's not hard to see the usefulness of this test.

Elsewhere, Exact Sciences is developing a multi-cancer early detection platform. It is also working on a next-generation version of Cologuard that would improve the test's accuracy. Exact Sciences should make meaningful headway in helping fight cancer in the next decade, and along with that, the company could deliver solid gains to investors. With $500, investors can buy five shares of Exact Sciences at their current levels of about $92 apiece. 

2. Pinterest 

Pinterest is a social media company that distinguishes itself from many competitors. Twitter and Facebook have been at the center of controversy related to heated political or social debates. Pinterest has largely avoided that, partly thanks to its focus on inspiring those engaged in creative endeavors, from cooking to fashion, home decor, and much more.

People don't go on Pinterest to debate divisive issues; other platforms exist for that. That's why the company can coexist with its competitors in social media. Pinterest makes most of its money from ads, an industry struggling lately as businesses have decreased their advertising budgets amid challenging economic conditions. Still, Pinterest is managing to grow its revenue. In the first quarter, the top line increased by 5% year over year to $602.6 million.

That was on the back of a 7% year-over-year increase in monthly active users (MAUs) to 463 million. Pinterest went through a period of about a year and a half during which its MAU count was declining or stagnant. With the tables turning, the company's top line growth rates should accelerate once the advertising market inevitably rebounds. But there are even more opportunities Pinterest is looking to exploit, one of which is to make its platform an e-commerce hub.

The company reports that more than 50% of its users see the website as a place to shop. While it is true that many other social media websites are looking to integrate e-commerce, Pinterest has an advantage many of its peers don't. It is already a place people go to find things they would like to buy, with its focus on images that are very good at eliciting desire in consumers.

Being able to purchase any item directly on the website -- that's Pinterest's goal, to make every Pin shoppable -- would make things easier and more convenient for users. Pinterest's opportunities in shopping, combined with its ad business, could make it a winner through the next decade. As of this writing, the company's shares are just under $25, so $500 is good for 20 of them, with some money to spare. Investing this sum into Pinterest would be a great move.