Stocks for the long term, eh? How long a term? Ten years? Well, that hasn't been so good. How about thirty years? Sorry, dear reader, but that hasn't worked lately, either.

The blaring Bloomberg headline earlier this week read, "Bonds Beat Stocks Over 30 Years for First Time Since 1861."

Ouch. Is that check and mate for the "long term" stock investors?

How did this happen?

Quite simply, 1981 was a great time to be an investor. It might not have seemed like it at the time -- interest rates were through the roof, inflation was screaming, there was general economic uncertainty -- but in retrospect, this is when you wanted to be pouring money into the market.

Interest rates may have crimped consumers at the time, but long-term bond yields were sky high, which also means that prices were low. At the same time, all of the skittishness caused investors to push valuations down in the stock market as well.

In short, if you were a buyer in 1981, kudos to you because you've done quite well whether you were buying stocks or bonds.

With both bond and stock yields (stock yield being earnings divided by price) crazy high back then, prices were low and poised to start rising. Ever since, we've seen a long stretch of rising prices for both stocks and bonds, while the yields for both have been in a race for the bottom. It's a race that bonds have been winning lately.

Sources: Irrationalexuberance.com and author's calculations. S&P 500 earnings yield = inverse of 10-year price-to-earnings ratio.

What happens next?

I'd love to say that something great is in store for investors, but it's tough to be quite that optimistic. With yields beaten down to a pulp, investors can either invest to collect those unattractive yields or they can get fed up, pull their money out, and let prices fall until yields are back at attractive levels.

That is, of course, oversimplifying the story, but we saw basically that scenario during the 30 years leading up to 1981.

Sources: Irrationalexuberance.com and author's calculations. S&P 500 earnings yield = inverse of 10-year price-to-earnings ratio.

It's worth noting that while rising yields meant lower prices for both assets, the fact that bonds started the period with a much lower yield meant that those investors had a much tougher time than the stock investors who were getting more attractive prices in the early '50s.

However, taking this all into consideration, I couldn't give a hoot who beat what over the past 30 years. What really concerns me is with prices high (and yields low) for both stocks and bonds right now, how the heck am I going to score decent returns over the next 30 years?

Sticking with stocks

Let me first say that I do have some of my retirement account invested in bonds -- across government, corporates, and high yield. I'm not quite so bold as to completely eschew diversification.

However, over the next 30 years I'm far more positive about stocks than I am about bonds. This is for two primary reasons.

Current yield. Whether you're looking at a one-year earnings yield, a 10-year, or something in between, the yield on stocks is a heck of a lot more than what you can get from bonds right now. Earnings growth. If you invest $1,000 in a vanilla 10-year Treasury bond today with a 2% yield, you'll get $20 per year for your investment over the next year. The year after that? $20. Five years from now? $20. However, if you invest that same $1,000 in a stock, there is the possibility that the earnings attributable to your shares will grow.

Combine those two points and I find it extremely hard to get excited about bonds at all.

Zeroing in

Of course even though I feel very comfortable saying that stocks are the better bet than bonds right now, there's still the issue that the yield on stocks overall really isn't all that attractive on a historical or absolute basis.

Sources: Irrationalexuberance.com and author's calculations. S&P 500 earnings yield = inverse of 10-year price-to-earnings ratio.

That's a bummer. However, it's a broad market, and not every stock is priced the same. For roughly a decade now, small- and mid-cap stocks have been beating the pants off larger cap stocks. It's been a painful stretch for anybody that owned large caps, but it's meant that, today, many of the biggest, highest-quality, most well-known companies out there are trading at the most attractive valuations.

The overall S&P 500's earnings yield based on 10-year average earnings is 5.2%. But General Electric's (NYSE: GE) yield based on the same metric is 9.5%. Oil giant ExxonMobil's (NYSE: XOM) is 8.4%. And 3M (NYSE: MMM) , Wells Fargo (NYSE: WFC) , and The Home Depot (NYSE: HD) all also have yields of 6% or better.

And lest we quickly forget, those yields absolutely clobber the 2% that you can currently get from a 10-year Treasury.

Of course, if we bring bonds back into the picture, we could toss earnings yields right out the window because the dividend yields on four of the five stocks above are above the 10-year Treasury rate. And if none of those stocks do it for you, every one of the stocks in The Motley Fool's special report "Secure Your Future With 11 Rock-Solid Dividend Stocks" has a dividend yield better than 10-year Treasuries -- some two or three times that. You can get your hands on a free copy of that report by clicking here.