Median prices for homes sold rose across Sonoma, Marin and Napa counties in June, while Bay Area averages reached the highest level in nearly four years, according to a report today from San Diego-based housing data tracker DataQuick.

The number of homes sold in Sonoma County rose 25.2 percent versus the same month in 2011, to 666. Median price rose by 6.4 percent, to $318,000.

In Marin County, the 332 homes sold in June represented a 6.1 percent increase. The median price rose 7.7 percent over the year, to $700,000.

Napa County saw a 23.7 percent increases in the number of homes sold versus June 2011, at 146 units. The median price rose 3.2 percent, to $320,000.

The DataQuick report isolated data for nine Bay Area counties. There were 8,577 homes sold across the region in June -- a 7.2 percent increase -- with average median prices rising 10.4 percent, to $417,000.

The median low point for the region was in March 2009, when Bay Area prices were $290,000. The recent peak was in June and July of 2007, at $665,000.

“Some of today’s stats are similar to what we saw in the thick of the housing downturn back in 2009, only in reverse: instead of foreclosure resales soaring, they’re waning, and instead of high-end sales slumping, they’re posting some of the larger sales gains,” said John Walsh, DataQuick president.

Mr. Walsh noted that the data also reflected a change in the “market mix,” with less discounted distressed properties changing hands and more normal sales occurring across the Bay Area.

Bay Area home sales remain under their long-term norm, according to the company. With data that began in 1988, June sales were 14.8 percent below the typical average.

Foreclosure resales accounted for 18.1 percent of sales in June, down from 26.1 percent in the Bay Area in the prior year. Short sales made up 18 percent of the regions resales last month, approximately flat from the same period in 2011.

Foreclosure activity remains high by historic standards, but is below peaks seen in the last three years, according to DataQuick.