High-yield bonds are on a roll: The iShares U.S. High-Yield Bond Index ETF (ticker: XHY) is up more than 11% for the year.

But before jumping on the bandwagon, be aware that there's lots of risk in high-yield, particularly after prices of these bonds have run up so sharply. To invest in high-yield bonds right now, it's important to do company-by-company analysis, not just to buy a sector or the market as a whole.

A high-yield bond is debt issued by a corporation with a lower credit rating than "investment-grade" debt. They are rated below "BBB" by credit-rating agency S&P, and below "Baa" by its competitor, Moody's. Bonds with these sub-investment-grade ratings pay a higher yield to compensate for their greater risk of default.

High-yield bonds are not for the faint of heart. Even those that end up being successful can take you on a rollercoaster of adrenaline. Right now, we are preparing to sell specific CCC-rated bonds that we originally bought at 85 to 90 cents, and are now trading at 100 cents on the dollar.

But these issues were trading around 30 or 40 cents in February and March. Bonds can go to 0, of course, and you can be sure that many investors, fearing they'd lose their entire investment, bailed and took a big hit during that nerve-racking period.

I continue to see opportunities in high-yield, for a number of reasons. The economy is continuing to gradually improve, which is a tailwind for troubled companies. Many investors are looking at the category because good yields are hard to find elsewhere. And foreign money continues to flow in to the U.S. markets, including high-yield, because of our country's economy and markets are stronger than most others around the world.

But a lot of high-yield bonds are potential traps. Issues from the retail sector are especially tricky because retail is a volatile business with very thin profit margins. If the economy tanks, or if consumers don't spend much during the holiday season, these companies will get hurt pretty badly, and could potentially default on their bonds.

On the other hand, we do like certain high-yield issues in the healthcare business because it's more stable and shock-resistant than a sector like retail. Some hospital operators' lower-rated bonds are paying a yield of around 10%. What's driven the yields up? In part, it's concerns about stubbornly weak core performance across the sector on stalling admissions, softer pricing, higher direct costs, and accelerating competition in already saturated markets.

These concerns are valid, but at the end of the day, the demand for healthcare services will always be reliable—people will continue to get sick and get injured no matter what happens in the economy.

Variable rate bonds, issued by banks and other lenders, may be a good bet at some point as well. They are usually fairly safe even as interest rates rise. The key is to make sure that they can't be called away by the issuer before maturity. And some energy companies are also starting to look interesting.

High-yield bonds can be a welcome source of both income and capital appreciation at a time when both of those things are hard to find. But the tradeoff is a willingness to accept more risk. To increase your likelihood of a successful investment, a keen eye and an understanding of balance sheets are required, along with a strong stomach. If you'd like to learn more about opportunities in high-yield debt, please contact us.