Real estate investment trusts reeled off their second straight year of 27% gains in 2010, according to the National Association of Real Estate Investment Trusts (NAREIT).

The FTSE NAREIT All REIT Total Return Index was up 27.6% last year, almost identical to the index's 27.45% gain in 2009. Last year's performance significantly outpaced gains in the S&P 500 (12.8%), the Nasdaq Composite (16.9%) and the Dow Jones Industrial Average (11.0%).

The top sectors were apartments (47.0%) and lodging (42.8%), NAREIT reported.

Of course, the stellar back-to-back years turned in by the FTSE NAREIT All REIT Total Return Index followed the major real estate downturn of 2007 and 2008, when the index lost 17.83% and 37.34%, respectively.

Going forward, the gradually improving economy bodes well for REITs. "REIT investors think that they do stand to reap the benefits of strong earnings growth over the next few years," said Brad Case, NAREIT vice president of research and industry information. "The strength in the stock market over the last few months of 2010 is very important news for REIT investors."

Regarding dividends, the average yield of 3.5% on equity REITs remains low by historical standards, but that still tops the average dividend of the S&P 500. By law, REITs must pay out at least 90% of their taxable income to shareholders in the form of dividends.