NEW YORK (Money Magazine) -- When Elisabeth and Tom Merrill decided to sell their home in Wenatchee, Wash. (pop. 107,000), they braced themselves for a long slog.

The couple and their four kids were bursting out of their 2,400-square-foot house, but they had read about the nation's slow-as-sludge real estate market and expected the worst.

But their house sold in 10 hours for $387,000, 80% more than they paid six years ago. "I was thrilled," says Elisabeth. "I can't believe how fast it happened."

While housing prices increased only 3.2% nationally in the year ended June 2007, according to the Office of Federal Housing Enterprise Oversight (OFHEO), a government regulator, prices in Wenatchee shot up 24%, partly because a recent influx of retirees boosted demand for housing.

Wenatchee is not the only hot spot bucking the national trend. Markets in the Pacific Northwest, Utah and Colorado still boast annual appreciation rates of 10%-plus, along with a scattering of bright spots in the South and even in the East and the Midwest.

How to account for these exceptions?

For the most part, the iron laws of supply and demand explain what's going on, with the added element of wild and crazy speculation. If you understand how such factors are playing out in these red-hot markets, you'll be better able to anticipate changes, and develop smart housing strategies, right at home.

It's the Demand, Stupid

The basics haven't changed. Job growth and rising incomes boost demand for, and prices of, housing.

Take Grand Junction, Colo. (pop. 140,000). The area is home to one of the country's richest natural gas fields, and local energy companies have recruited new employees, ballooning the city's work force by 26% since 2002 to about 63,000. The median price of a house in Grand Junction soared 65% in the past five years and 14.3% in the past year.

"Along with previous price gains, job growth is by far the most significant variable in forecasting growth," says Robert Shiller, co-founder of a home-price research company and professor of economics at Yale.

Whether Grand Junction will be able to sustain that steep growth curve depends on whether jobs keep increasing and people come to take them.

"If you don't have strong population growth, it's likely that the market won't appreciate in the long term," says Celia Chen, director of housing economics for Moody's Economy.com.

Case in point: Denver, only a mountain range away. The number of jobs has grown by only 7.8% in the past five years, holding house prices to a tepid 13% rise over the same period.

Supply Side

If it's not demand pushing prices up, it's got to be you-know-what.

One city where housing is tight: Portland, Ore., which has passed some of the most stringent growth restrictions in the country.

The government limits new housing outside a 400-square-mile perimeter to encourage denser development in urban areas. Land costs have skyrocketed and developers have been slow to add housing. So despite the slide in national house prices, in Portland they appreciated by about 8% in the past year.

Portland's policies have been partly responsible for price run-ups in outlying towns like Longview, Wash. (pop. 35,000), says Glenn Crellin, director of the Washington Center for Real Estate Research.

Once a sleepy town, Longview, an hour's drive from Portland, draws home buyers looking for lower prices. (The median price of a house there is $183,000, but $298,000 in Portland.) Prices shot up in Longview by 13.6% in the past year.

With tight supply and high demand, prices could have a tailwind indefinitely.

A trio of economists, Joe Gyourko, Christopher Mayer and Todd Sinai, have argued that persistent growth in cities they dub "superstars" (for example, New York City and San Francisco) is fueled by a limited supply of housing and by a concentration of high-income families who are willing to pay top dollar to live there.

True, both cities have hit bumps in the road in the past, and prices over the past year in the New York metro area rose by only 2.7% while in San Francisco they sank by about 1%. But, Gyourko says, "over the long term they will outstrip the national average."

The Madness of Crowds

Rampant speculation can also keep home prices burning.

The frenzy starts, naturally enough, when economic growth increases housing prices and property owners profit big when they sell. More people buy houses or condos, by the dozen, figuring that they'll earn a bunch of quick bucks instead of just one.

Real estate developers, seeing others profit, get in on the act by building thousands more homes. Eventually, speculators are merely selling to one another at ever more inflated prices. And when the last to buy or build can no longer flip those houses, prices plummet.

That's what happened in Miami and other South Florida towns where investors ran out of buyers who could afford to pay.

At the height of the bubble, prices in Miami were rising by 3% to 4% a month. Now only about 10% of homes in Miami are affordable for residents earning the area's median income, according to the Housing Opportunity index, published by the National Association of Home Builders and Wells Fargo. (The index assumes that homeowners can spend about 28% of their income on housing. )

Bubble burstings occurred in other cities too. "Las Vegas saw tremendous appreciation during the boom," says Andrew Leventis, a senior economist with OFHEO. "Prices just got ahead of themselves." Affordability dropped to just 16% by mid-2006 and home values tanked, declining by 6%, according to Zillow.com, an online real estate appraisal service.

Housing in one hot market, San Antonio, where prices rose 10% in the past year and 40% in the past five years, is still fairly affordable. But it may soon go the way of Miami and Las Vegas. Between 25% and 29% of loans in the city in 2006 were for second homes or investments, according to Freddie Mac.

"It suggests instability in the market," says Robert Shiller. "Prices could drop significantly."

What It All Means

You're not going to pick up and move to Wenatchee, Wash. just to get into its housing market. But today's hot markets can tell you a great deal about the value of your own housing investment.

If the economy's okay, your market will be too... You needn't worry about house prices collapsing if local industries are doing well. By merely reading the business section of the local paper, you get a sense of the economic climate.

Announcements that companies are expanding or building new factories, or conversely, moving operations to Uttar Pradesh, can tell you where house prices are headed.

For example, a headline in the Beaumont Enterprise last year proclaimed that the Beaumont, Texas area was "poised for economic progress." The expanding petrochemical industry was looking to recruit 18,000 new employees. And in the year ended June 2007, the average price of a house in Beaumont/Port Arthur rose by 10.6%.

...as long as speculators aren't dumping properties. If they are, your local market could be headed for a bubble pop.

Signs that investors are rife? FOR RENT signs lining the streets and no cars in the driveways at night. If you're buying a new home, make sure the developer restricts investors from buying up too much of the inventory.

Hot pockets exist even in chilly markets. Even apr�s-bubble, prices in some neighborhoods will be on the upswing.

For example, in the Boston metropolitan area, home values dipped 4% in the past year, according to Zillow.com. But in Newbury (pop. 7,000), another Boston suburb, where the median value of a home is $491,000, prices appreciated 8%.

Typically, such trend-upsetting enclaves are lukewarm neighborhoods that haven't seen the rocketing prices of "hot" markets down the road, says Stan Humphries, vice president of data and analytics for Zillow.com. "As some neighborhoods become radically more expensive, prices push buyers to the formerly less attractive places and put upward pressure on prices."

The laws of economics still apply. Cycles happen.

Five years ago it looked like fat year-to-year gains in home prices would continue forever. That assumption came crashing down earlier this year when a Standard & Poor's report showed that home prices in the first quarter had fallen for the first time in 16 years. That too will end. But since housing generally has a 10-year price cycle, you shouldn't rely on prices rising much for the next decade.

If you've owned a house for a while, you don't have to worry. The gains you've enjoyed in recent years are huge compared with recent price downturns.

Even if the median price of a single-family home in Miami, now $393,000, falls by 20%, the price on that house would still be about $20,000 higher than it was at the end of 2004.

"With all the sound and fury associated with the recent downturn, in the places with the most dramatic price declines, they've only erased a few quarters of appreciation," says OFHEO's Leventis. "Long term, prices still tend to go up."