NEW YORK ( TheStreet) -- Fund investors may be cheering the market rally, but higher stock prices come with a painful side effect: bigger tax bills.

If stocks hold onto their gains, plenty of investors in taxable accounts can expect to lose more than 15% of their returns to the tax man.

To avoid paying Washington, financial advisers have long recommended a variety of strategies, such as investing in exchange-traded funds or buying mutual funds with low portfolio turnovers.

But many of the conventional tax strategies can fail. Instead of following rules of thumb, investors should keep a close eye on how much funds actually return after taxes. The aim should be to buy funds that have delivered strong aftertax returns in the past and seem likely to continue performing well in the future.

Consider ETFs. In theory, ETFs should be more tax efficient than competing mutual funds, but in the real world the results vary.

To appreciate the complexity of finding the most tax-efficient choice, compare the Vanguard 500 Index ( VFINX) -- the largest S&P 500 mutual fund -- and two popular ETFs: the iShares S&P 500 ( IVV) and SPDR S&P 500 ( SPY).

All three funds track the S&P 500, and all returned about 3.2% annually during the past 10 years, according to Morningstar. But on an aftertax basis, the mutual fund was superior.

After taxes, investors in the top tax bracket would have an annualized return of 2.83% in the Vanguard fund. The iShares fund returned 2.69% after taxes, while the SPDR returned 2.62%.

Why did the old-fashioned mutual fund outdo the ETFs?

Vanguard uses a strategy that involves separating a portfolio into tax lots and selling stocks to book losses.

Say the fund buys a stock at $10. In subsequent weeks the shares rise, and the portfolio managers buy more of the same stock at $11 and $12.

Now the stock drops back to $11. If the fund needs to provide cash to departing shareholders, the portfolio managers must sell stocks.

To limit tax bills, the managers sell the group of stock that was purchased at $12. That will result in a capital loss that can be used to offset gains and help make the fund tax efficient.

If you liked this article you might like

Stock Observations; Reviewing Equities: Doug Kass' Views

Even North Korea's Kim Jong Un Can't Stop This Epic S&P 500 Stock Rally

Robots Might Be Biggest Obstacle for Stock Market Bears

This Simple Indicator Is Hinting at an Imminent Stock Market Plunge

Investors Waiting for Disaster?