Image source: Getty Images.

These have been exciting days for people who dream of becoming millionaires. The Powerball and Mega Millions lotteries, after all, have recently seen their jackpots surge into the hundreds of millions of dollars.

Lots of Americans see the lottery as a reasonable way to try to become rich, but they're deluding themselves: It's not likely to happen by chance. They could become millionaires, though, if they try a different approach -- investing.

Lottery tickets are not a reliable road to riches. Image source: Pixabay.

Bad odds

Let's first review just how unlikely it is that you'll ever win one of these big jackpots. The odds of winning the Mega Millions jackpot are one in 259 million, while they're one in about 292 million for Powerball.

It can be hard to comprehend the enormity of those numbers, so consider this: There are about 320 million people in America. Imagine that just one of those people is selected, and think about how likely it is to be you. That's not far off from how likely you are to win the Powerball jackpot.

To get your head around the Mega Millions jackpot odds, consider that the King James translation of the Bible consists of about 783,137 words. Imagine a stack of 330 such Bibles -- and then imagine selecting just one word in one of them. That would be a one-in-259-million selection.

See? Even though, yes, some people do win these jackpots, it's really, really, really unlikely to be you (or anyone else).

A good alternative

Fortunately, you don't have to pin your millionaire dreams on those terrible odds. Instead, consider investing money regularly in the stock market -- for a long time. Over many decades, the stock market has averaged annual gains near 10%. (During any shorter period, of course, your own returns are likely to be at least a bit higher or lower.)

Check out the following table that shows how you can build a powerful portfolio over time. It shows how your money will grow if you sock away $10,000 each year and it grows by 10%:

After...

You'll Have...

10 years

$175,312 

15 years

$349,497

20 years

$630,024

25 years

$1.1 million

30 years

$1.8 million

35 years

$3.0 million

The results above are not guaranteed, but over many decades, the stock market has grown, and is likely to increase your wealth -- far more than any lottery ticket is likely to do.

It's even more likely that you can make your kids, or grandchildren, millionaires -- if you can invest a modest sum for them, and leave it to grow for many years. The table above reflects the growth of annual $10,000 investments. Check out what happens to a single $10,000 investment over several decades:

$10,000 growing at 10%

Becomes

Over 10 Years

$25,937

Over 20 Years

$67,275

Over 30 Years

$174,494

Over 40 Years

$452,593

Over 50 Years

$1.2 million

Over 60 Years

$3.0 million

Image source: Getty images.

Ways to go about investing

A fine way to invest in stocks is via a simple, low-cost broad-market index fund, such as the Vanguard 500 Index Fund (VFINX -0.21%), which distributes your assets across 80% of the U.S. market. The Vanguard Total Stock Market ETF or the Vanguard Total World Stock ETF will, respectively, have you invested in the entire U.S. market, or just about all of the world's stock market.

If you have the time, skill, and interest, you might invest in individual stocks, too, as some of them will grow at a faster clip than index funds. Finding the long-term winners is easier said than done, though.

Johnson & Johnson, as an example, has averaged 14% annually over the past 30 years, while Wells Fargo has averaged 15%. You don't need to find exciting new companies in order to profit -- established, familiar names can serve you quite well.

It's smart to take advantage of Roth IRAs, too, as they promise tax-free withdrawals in retirement. For 2016, the contribution limit for IRAs is $5,500, with an extra $1,000 allowed for those 50 years of age or older. You may be able to accumulate hundreds of thousands of dollars in a Roth IRA, eventually tapping it without paying Uncle Sam anything.

Buying a lottery ticket now and then isn't a sin -- as long as you can afford it, and you aren't basing your retirement on it. Think of it as buying you a few days to dream. Investing in the stock market over many years can deliver on that dream, though, so consider taking action soon. Play the game with the best odds.