NEW YORK (TheStreet) -- Vanguard REIT Index Fund (VGSIX) - Get Report has been topping most actively managed competitors. During the past three years, the fund returned 9.5% annually, surpassing 87% of all real estate funds tracked by Morningstar (MORN) - Get Report.

At first glance, that strong showing may not appear exceptional. After all, many low-cost index funds deliver healthy results. But what makes Vanguard's showing intriguing is that the index fund's strong performance represents a dramatic turnaround. From 1998 through 2009, the Vanguard fund trailed the category average in eight out of 12 years. Then in 2010, the index fund began a streak of four consecutive years when it topped the average.

Have the active portfolio managers become stupid? Probably not. Morningstar analyst Abby Woodham has a theory about why the index fund lagged in earlier years and has surged lately. Real estate funds invest primarily in real estate investment trusts, which own portfolios of commercial properties, such offices and hotels. In the 1990s, publicly traded real estate represented a tiny sector that attracted few investors, says Woodham. Most REITs were unloved small stocks. With few Wall Street analysts covering the industry, many shares were mispriced. That made it relatively easy for active managers to top the benchmarks by spotting undervalued stocks, says Woodham.

Then REITs began expanding and attracting new investors. Many index funds were forced to buy shares when REITs entered the S&P 500 and other benchmarks. As Wall Street coverage increased, fewer stocks were mispriced and active managers had a more difficult time excelling. "Now REITs trade more efficiently, and there is less room for a masterful active manager to outperform," says Morningstar's Woodham.

After being crushed in 2008, REITs began a monster rally in 2009, outpacing the S&P 500 for four consecutive years. As REIT shares moved straight up, the index fund had some clear advantages. While the passive portfolio provides a pure dose of REITs, actively managed funds hold cash and sometimes stocks that are not REITs. At a time when REITs were soaring, other assets slowed actively managed funds.

Should you forget about active funds altogether? Maybe not. REITs have languished in the past year. If the rough going continues, cash will provide a cushion instead of a drag. "If we enter a bear market, then the active managers could pull ahead," says Woodham.

To try an active fund that could potentially excel in up and down markets, consider Cohen & Steers Realty Shares (CSRSX) - Get Report, which returned 9.5% annually during the past 10 years, topping the Vanguard index fund by 1 percentage point. The Cohen & Steers managers are willing to move away from the index, overweighting real estate sectors that appear undervalued.

The fund currently has a sizable position in retail properties, including malls and shopping centers. Shares of some malls have softened as investors worry that hard-pressed consumers could skimp on purchases or shop on the Internet.

But the Cohen & Steers managers figure that premier malls will hold their positions because of their strategic locations and popular stores. Portfolio manager Chip McKinley likes Simon Property Group (SPG) - Get Report. Simon operates dominant facilities that have been increasing their sales as upscale consumers patronize their favorite stores. "The low-quality malls may have difficulties, but Simon's premier malls should stand up to the competitive pressures from the Internet," says McKinley.

McKinley also likes premier office REITs, including Vornado Realty (VNO) - Get Report, which has properties in New York and Washington. Growing employment in social network and technology companies is increasing demand for space. But supplies of new space are limited because of the lingering effects of the financial crisis. During the downturn, building prices declined. Since then prices have strengthened, but it is still cheaper to buy an existing building than it is to build a new one. As a result, cautious lenders are reluctant to finance new construction. That should enable Vornado to raise rents on its existing properties and deliver increased earnings.

At the time of publication, the author held no positions in any of the stocks mentioned.

Follow @StanLuxenberg

This article represents the opinion of a contributor and not necessarily that of TheStreet or its editorial staff.

Stan Luxenberg is a freelance writer specializing in mutual funds and investing. He was executive editor of Individual Investor magazine.