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.

If you don't look too closely, you might think it's 2007 all over again.

Thanks to the recent bull rally, foreign stock markets are racking up double-digit returns. The MSCI EAFE index, a benchmark of developed nations, soared 32% in the three months ending May 29. Third-world nations, meanwhile, have trounced those gains, with the MSCI Emerging Markets index surging 56%. Those numbers make our home-grown returns looks comparatively anemic—the S&P 500 is ahead by just 25.8%.

The overseas performance edge should be no surprise, given the troubled U.S. economic forecasts. Ultrabearish economist Nouriel Roubini expects the U.S. to remain in recession this year; and for the next two years, he sees only a weak recovery. Meanwhile emerging markets economies, such as China and Brazil, are expected to grow by as much as 10% this year. The MSCI BRIC index, which tracks the booming economies of Brazil, Russia, India and China, soared 60% during the rally.

Even faster growth is expected in so-called frontier markets, which are smaller, less developed nations that don't qualify even for emerging markets status. (For more on frontier markets, see this story). The MSCI Sri Lanka index is up 80% over the past three months, while Romania has skyrocketed 110%. Franklin Templeton's Mark Mobius, considered the dean of emerging markets investors, has said he is putting more of his personal money into frontier markets (subscription req.).

Many retail investors are way ahead of him. In the first four months of this year, nearly $8 billion in new cash flooded into emerging markets funds, according to Financial Research Corp., even as investors pulled money out of U.S. and other foreign stock funds.

If you think you've seen this movie before, you have. Big surges in emerging markets have invariably led to big busts, which are usually far worse than domestic losses. The MSCI emerging markets index plunged 55% in 2008 vs. 37% for the S&P 500. This year's blistering run-up, though it does not erase those losses, is reason for caution. As noted bear Jeremy Grantham announced at a Morningstar conference last week, "you can bet on" a bubble forming in emerging markets stocks.

One reason for the big swings is that investing in emerging markets is, to a large extent, a bet on commodities. After all, production of raw materials, such as oil, precious metals, and the like, is the main engine for many of these growing economies. The typical Latin American fund holds more than 40% of its portfolio in energy and industrial material stocks, according to Morningstar.com. The top holding, at 26% of assets, is oil giant Brazilian Petroleum Corp. Volatility, anyone?

None of which means you should avoid emerging markets altogether. But if you don't want a repeat of last year's losses, invest carefully. Most advisers recommend keeping only 5% to 10% your portfolio in these markets. If you haven't jumped in already, consider dollar cost averaging, so you can take advantage of any downturns by buying more shares. And if you've already invested, now may be the time to take some profits.