Before the housing market roared and crashed with the intensity of a tidal wave, Dave Henry owned as many as a dozen properties dotting the New Jersey shore.

He sold some when home prices began peaking in 2005, making a profit of more than 30 percent, he said. But by the following year, when the market's titanic gain had plummeted, the Upper Township resident started shedding properties again - at a 30 percent loss.

"As fast as everything went up, it came down. You really had to watch your money," said Henry, 58, who still owns two rental homes in Ocean City. "At the end of the day, if you're in the plus column, it's all good."

Such is the gamble taken by investors, speculators, second-home owners and year-round residents of New Jersey's coastal communities. That eclectic mix of ownership is why shore real estate for years had thrived ahead of the mainland and the rest of the state's prime housing market. Buyers at the shore have often been older, knowledgeable about investing and wealthy enough to afford second homes, particularly in luxury enclaves near the ocean.

But the shore market was not immune from the extraordinary shakeup in housing values and prices that preceded the economic recession that began in late 2007, although there now is a growing consensus that the market has hit bottom and is turning around, area real estate agents and economists say.

The Press of Atlantic City analyzed property data for 35 municipalities in the four counties that make up New Jersey's 127-mile coastline, from Sea Bright in Monmouth County to Cape May Point in Cape May County.

Fiscal years 2003 to 2008, which run from July 1 to June 30, were examined, focusing on housing prices and home sales of at least $50,000. The most recent available data from 2009 also was compiled, although it is about two weeks short of a complete fiscal year.

The Press' analysis found that the shore market is returning to a pre-boom level and prices are becoming more affordable.

All but seven shore towns had median home sales in 2009 that were lower than the previous three years. Among the lowest were West Wildwood, down 35 percent, Avon-by-the-Sea, down 27 percent, and Belmar, down 24 percent.

That decline in median sales prices is helping to spur home sales. Every town saw sales go up in the past fiscal year except for Brigantine, West Wildwood, Sea Girt and Bay Head. (Sales are still way off from 2003, but there also has been a general decline in housing construction during the recession.)

Stephen Booth, market manager for Prudential Fox & Roach in Ocean City, believes the market has already hit bottom.

"If you look at what properties are selling for now, there are values out there that haven't been there for years," Booth said.

Higher-end still suffering

The shore market, because it is a secondary one, is dominated by investors who take advantage of the cyclical nature of real estate. They invest in the market sooner than regular buyers who may be more cautious about spending money.

But this recovery, unlike previous ones, is "working from the bottom up," Booth said. "In this one, we're lagging behind."

Robust sales of higher-end homes usually indicate that the shore market is healthy. Prices there rise greater than the general market since seaside living is considered more desirable and available land along the coast is limited. Essentially, there is a lot of demand, but limited supply - which drives up prices.

Even in 2009, 14 seaside towns had median home values higher than $600,000, with five of them topping $1 million or more.

Mantoloking in Ocean County, which has only about 450 year-round residents and belongs to an exclusive part of the shore called the "Gold Coast," had the highest median home value of $3.2 million.

But the most expensive home sold in 2009 was in Long Beach Township, one of six municipalities on Long Beach Island, for $8.7 million.

And even now, an 8,000-square-foot estate in the township, with eight bedrooms, five bathrooms, marble sink countertops and a spiral wooden staircase is listed just under $15 million.

"One of the few remaining tracts available on Long Beach Island, and the largest of its kind!" according to its listing.

But Realtors from Monmouth County to Cape May County say the sales of those premium properties have been anemic in this downturn, which is why some believe the market is lagging.

"The $1 million (home) and above is very slow," said Mark Carrier, president of Carrier Sotheby's International Realty in Brigantine. "The jumbo loans are available for those types of properties, but buyers are really skittish about the economy, and they're wondering when this recession is going to end."

Jeffrey Quintin, who heads his own team of real estate agents in Ocean City under Prudential Fox & Roach, said there is still too much inventory on the market. Ocean City generally has the most annual transactions of all the shore towns and was averaging 168 per month when housing prices took off in 2004.

The island resort's inventory of unsold homes was at a three-month supply then, Quintin said. Now, it is at a 20-month supply.

"The inventory needs to be at eight months or less to see a shift in the market," Quintin said. "But there's still less inventory now than a year ago."

Doing much better are homes under $600,000, real estate agents say, and buyers - some who previously were relegated to renter status in the market - are pouncing.

Quintin said a home on West Avenue in Ocean City, about three blocks from the beach, sold this year for $405,000 and had several bidders. The three-bedroom, one-bathroom cottage was worth as much as $600,000 in 2004.

"The market has really come down, and as prices have adjusted downward, more people can afford them," Quintin said.

Buying and selling

On a recent Saturday morning, Quintin met client Tom Rowe and his fiancee, Sue Petrimoulx, at a condo on Ocean City's Asbury Avenue. One section of the residential street, a stone's throw from the ocean, is lined with cream-colored homes and "for sale" signs.

"Everything's so neat," said Petrimoulx, as she peaked around the three-bedroom unit dressed up in a beach theme.

Rowe and Petrimoulx, of Glenmoore, Pa., were beckoned by the oceanfront neighborhoods of Ocean City when they first bought a second home there in 2004. The city markets itself as "America's Greatest Family Resort."

"Since I was little, I always wanted a house at the shore," Petrimoulx said.

Now, the couple is looking to upgrade again to a bigger place that can accommodate visiting grandchildren. They are considering renting out their current condo if they find a new place to call home.

But this Asbury Avenue unit wasn't it.

Its current owners, David and Kathy Ostermayer, of Medford, Burlington County, are listing the condo for $519,900 - just above the city's median sales price from June to August of $471,250.

The Ostermayers bought the condo in 1998 for $195,000, and saw how its value skyrocketed - then deflated - in a decade.

But they're long-term owners who want to buy up and purchase again in Ocean City. And they're the type of sellers who are not interested in inflating home prices on the off chance they can make a huge profit.

Now that prices are lower and there is still a large inventory of homes available, Quintin said, the market will benefit by people selling based on realistic values.

"You hope not to lose money in the process," Kathy Ostermayer said. "Hopefully, we'll break even."

Disappointed that they had missed the boom of a few years ago, her husband still wouldn't mind doing better than that. "Hopefully, we'll make money," he said.

E-mail Erik Ortiz: