Many companies featured on Money advertise with us. Opinions are our own, but compensation and
in-depth research may determine where and how companies appear. Learn more about how we make money.

Money is not a client of any investment adviser featured on this page. The information provided on this page is for educational purposes only and is not intended as investment advice. Money does not offer advisory services.

Illustration by Taylor Callery for MONEY

Wall Street has many maxims, such as "Buy low and sell high," "Don't fight the Fed," and, for some, "Clear your browser history after insider trading." One of the best is "Don't reach for yield," meaning investments with enticing payouts are often too risky. But you can make an exception for high-yielding municipal bond funds, which invest in debt issued by states and municipalities with less-than-pristine credit for public works projects.

This may sound odd given the recent headlines surrounding Puerto Rico's historic default, which is still ongoing. But you have to see the bigger picture.

Puerto Rico is by no means an island when it comes to credit issues. Illinois and New Jersey are also on shaky ground, and Atlantic City was close to defaulting. Overall, however, the cumulative default rate for munis over a decade has been just 6%—about a fifth that for corporate junk bonds, says John Lonski, managing director and chief economist at Moody's Analytics. Even with Puerto Rico's debt crisis, high-yield muni funds are up 7.6% over the past year, vs. the 2.9% loss for corporate junk bond funds.

Calculator: Compare taxable, tax-deferred, and tax-free investment growth

Remember, too, that states can't go bankrupt, and cities and towns will go to greater lengths to avoid bankruptcies than companies will. Munis are also less likely than corporate or junk bonds to swoon at the same time stocks do, so they can buffer your equities better.

The prudent play

High-yield muni funds are paying 3.99%, with a bonus that this income is free from federal and sometimes state income taxes. For someone in the 28% bracket, that's the equivalent of 5.54% yield, three times what 10-year Treasuries and twice what 10-year corporates are paying. "I've never seen a market this technically strong," says John Wiley of Franklin High-Yield Tax-Free.

Not only is there plenty of demand, but issuance is low. Because of limited supply, though, prices on existing bonds are high, argues Mike Walls, manager of Ivy Municipal High Income Fund. So "we need to be cautious—not overly cautious," says Walls, who doesn't see a recession in the wings. Part of that caution is focusing on higher-grade securities within the high-yield universe and having enough cash on hand to scoop up bargains if the market runs into bumps.

Two low-cost funds with higher-than-average cash stakes are SPDR Nuveen S&P High Yield Municipal Bond ETF , which has beaten 99% of its peers over the past three and five years, and Vanguard High-Yield Tax-Exempt , which yields 3.63%—just a hair under the average for high-yield muni funds—despite keeping a majority of its assets in higher-quality bonds.

Columnist John Waggoner is the author of three books on Wall Street and investing.