For years now, investors have turned to dividend stocks to get the income they need. With other traditional sources of income largely falling flat and failing to deliver enough cash flow, especially for retirees, stocks with impressive dividend yields have helped many people bridge the gap between the income they need and what standard bank accounts and other safe investments provide.

But with all the hype about dividend stocks, some investors are looking for ways to diversify beyond them. One popular choice has been corporate bonds, especially high-yielding bonds. But with the appetizing nickname of "junk" bonds, are corporates really a smart play -- or an invitation for disaster?

Why one investor's junk is another's treasure
At first glance, the appeal of corporate bonds seems to be just another example of how desperate investors often stretch to get as much yield as they can from their portfolios. After all, compared to Treasury bonds, corporates come with default risk -- if something happens to a company that issues bonds, then bondholders may end up losing part or all of their investment, just like regular shareholders do. The trade-off is that corporate bond investors earn extra yield that's intended to compensate them for the additional default risk.

Recently, though, there have been some signs that the bond market is overcompensating investors for that risk. A study from Babson Capital Management cited in Barron's noted that with default rates on high-yield bonds at roughly half their historical levels, the current extra interest that junk bond owners are getting implies that those default rates will nearly triple from their current levels.

Another analyst pointed out that as rates on Treasuries and most other bonds have fallen, junk bond yields have actually gone up. That's extremely useful for investors who needed that additional income.

The other side of the trade
Before you line up to buy junk bonds and other corporate debt, though, consider the other end of the supply-and-demand equation. According to Moody's, U.S. companies will need to refinance about $1.3 trillion in maturing debt over the next five years. More than half of that is junk debt, split between corporate bonds and bank-provided credit.

Also, prices have already jumped substantially, prompting new issuers to come to market sooner than later. Petrobras (NYSE: PBR) plans to sell about $6 billion in the near future, as it seeks to raise capital to develop its offshore assets, which carry the challenge of ultra-deepwater drilling. Goldman Sachs (NYSE: GS) was able to lock in a 5.3% yield on 10-year notes last month. That's a big spread to Treasury yields below 2%, but for an institution that still faces uncertainties about the global financial system, the premium is understandable. JPMorgan Chase (NYSE: JPM) got an even better deal, with a 5.1% yield on 30-year debt to help it lock in cheap capital for decades in light of the potential for dramatically higher interest rates down the road.

Moreover, when you look at some corporate bonds, the yields are only attractive compared to rock-bottom rates on Treasuries. Kroger (NYSE: KR) issued a five-year note for less than 1.8% in yield, despite the company having only a BBB rating. And even with the challenges that the Japanese earthquake and tsunami last year raised, newly issued Toyota Motor (NYSE: TM) debt yields only 1.7%.

Be careful out there
Corporate bonds in general and junk bonds in particular are getting a lot of attention. But before you invest in the area, make sure you fully understand the risks and rewards involved. Some corporates -- even junk bonds -- are a good deal, but others have traps for the unwary. If you can't tell the difference, then you'd be better off leaving the space to those who can.

A key part of a secure retirement is having the income you need. The Motley Fool's latest special report looks at several stocks that have the features you need to have a rich retirement. It doesn't cost a dime -- but grab it today while it's still available.

Tune in every Monday and Wednesday for Dan's columns on retirement, investing, and personal finance. You can follow him on Twitter here.