Let's face it: Americans have lottery fever. Since there was no grand prize winner after Wednesday's drawing, the multistate Powerball jackpot soared to more than $1.23 billion -- and will likely be higher by the time you read this.

People spent more than $100 billion in 2023 on state-run lotteries, yet the chances of winning the big one are astronomical -- roughly 292 million to 1. In fact, you have a better chance of being struck by lightning (15,300 to 1) than winning the big jackpot. There's got to be a better way.

Investing in stocks gives you a much better chance of success. The S&P 500, the U.S. stock market bellwether, has returned 10% annually, on average, over the past 50 years, though the returns have varied year to year.

One of the biggest opportunities in recent memory is advances in the field of generative artificial intelligence (AI), which can automate many time-consuming tasks, making workers more productive. Cathie Wood, the CEO of ARK Investment Management, is among the technology's biggest advocates.

In Ark's Big Ideas 2024 report, Wood estimates that generative AI software could generate $13 trillion by 2030. Her bull case is even more eye-opening -- at roughly $37 trillion -- which could deliver a potential windfall for companies in the field and their investors.

Below, I'll look at two companies that are uniquely positioned to begin reaping their share of those rewards now.

A person leaning on their hand inspecting various lines of AI code.

Image source: Getty Images.

Palantir Technologies

Palantir Technologies (PLTR 0.87%) already had a long track record of creating AI-powered solutions, with the U.S. government and its allies as customers for more than 20 years. The company has long since branched out, supplying data mining, analytics, and AI services to enterprises. With its decades of experience in the field, the company was ready when demand for generative AI surged.

The fruit of its labor is the Artificial Intelligence Platform (AIP). Rather than providing companies with generic solutions, Palantir conducts boot camps that address existing, real-world problems that businesses face.

Users identify mission-critical needs and high-value use cases, working side by side with Palantir engineers to craft AI-based solutions to these problems. "In these immersive, hands-on-keyboard sessions, participants can expect to go from zero to use case in just one to five days," Palantir wrote in a blog.

This strategy has been wildly successful. Management planned to conduct 500 AIP boot camps over the course of one year, but thanks to strong demand, Palantir surpassed that goal, completing 560 boot camps in just four months.

The company's fourth-quarter results help illustrate the surging demand. Palantir's U.S. commercial revenue grew 70% year over year and 12% sequentially, fueled by strong demand for AIP. In 2024, management is forecasting growth for the segment of at least 40% -- though its guidance could well be conservative.

Palantir's valuation looks a bit frothy, but it isn't as simple as that. The stock currently sells for 70 times forward earnings and 16 times forward sales, multiples that would send some investors running for cover. However, when measured using its forward price/earnings-to-growth (PEG) ratio -- which takes into account its growth prospects -- the stock clocks in at less than 1, the standard for an undervalued stock.

Microsoft

Another company at the forefront of the generative AI movement is Microsoft (MSFT -1.10%). Management recognized the potential for these game-changing algorithms early on and planned accordingly.

The company invested $13 billion in OpenAI, the company behind Chat-GPT. By working closely with the start-up, Microsoft was able to develop AI-powered assistants -- called Copilots -- that help increase user productivity.

Rather than focus on generic solutions, Microsoft developed Copilots for specific use cases. Its flagship version is Copilot for Microsoft 365, for users of its workplace productivity tools.

There's also GitHub Copilot, which helps developers write and debug computer code. There are also versions geared toward those with jobs in sales, service, and finance, with others on the drawing board.

Early indications are that Microsoft has a smash hit on its hands. A survey of Copilot users found that 70% said they were more productive, while 68% said Copilot improved the quality of their work. Perhaps most importantly, 77% said that once they used Copilot, they "didn't want to give it up."

To be clear, Microsoft hasn't yet reported a full quarter of results that include Copilot, and different versions are being rolled out over time, so it won't be easy to measure the direct impact. That said, analysts are extremely bullish on the potential for Copilot, but Wall Street's forecasts vary wildly.

Analysts from Piper Sandler suggest the technology could generate incremental revenue of $10 billion by 2026. Analysts at Evercore are much more bullish, estimating that Copilot could add $100 billion in incremental revenue by 2027.

Microsoft is currently selling for 36 times forward sales, which is a premium, compared to the multiple of 28 for the S&P 500. However, given the company's strong track record of growth and its early start in the AI revolution, a premium in this case is warranted.