This chart shows the annualized return on an investment in the S&P 500. I got this idea after seeing this beautiful chart in the New York Times done by Crestmont Research. Their site has larger versions that have more years.
The money is invested in the year on the left (from 1950-2009) and taken out of the market in the year on the top. There are options to adjust for inflation and to invest it every month instead of all at once. Mouseover individual cells to see more precise values, along with the average annual amount of inflation. The bold squares represent 20 years spent in the market.
Note that after inflation, you can reasonably expect 2-3% annual return if you stay in the market for a long time (at least 30 years). This is a much less rosy picture than the 7% or 10% I've commonly read.
Interestingly, I would have thought dollar-cost averaging would do better, but since the market trends upward, if you have a lump sum of money it's more often better to invest it all at once. Of course, in periods when the market is down (say from 1999-2010), dollar-cost averaging generally does better.