The median price for a Bay Area home hit a record $845,000 in October, while in Los Angeles County you'll be paying $615,000 for a home on average. This begs the question: Is there anywhere in California that's still remotely affordable?

Even in the most affordable cities in California (with populations over 50,000), incomes can't keep pace with the high costs of housing, a new analysis finds.

The most affordable city in California is Visalia, 230 miles southeast of San Francisco, according to a report created by HomeArea.com, a real estate listing site. HomeArea compiled its ranking by looking at the median multiple — a metric recommended by the United Nations and World Bank that compares local home prices with local incomes that helps economists determine a region's affordability — of California cities with populations over 50,000.

A median multiple under 3.0 is considered affordable, essentially indicating that average homes cost about three times the typical annual salary, before tax. The figure for the state as a whole is 7.1, and it keeps rising.

Visalia, on the other hand, has a median multiple of 3.6. It's followed in the ranking by Clovis, Bakersfield and Hesperia. You can see the rest of the top-10 most affordable California cities in the above gallery.

Zillow estimates the median home value in Visalia is $234,500 — a seven-percent increase over last year — and the median household income is $54,934, per census data. The city's primary industries are agriculture and light manufacturing.

HomeArea also reported the least affordable cities in California. Newport Beach is at the top of this list, with a median multiple of 15.0, followed by Santa Monica, Glendale, Santa Barbara and Palo Alto. San Francisco was not far behind, with a median multiple of 10.

Issi Romem, chief economist for Trulia, said the median multiple, though a sensible metric, should be interpreted with caution, especially for finer geographies, like cities and counties.

"Obviously, if the set of residents is fixed, then higher home values imply less affordability and vice versa, but what happens when the set of residents can vary depending on the housing prices?" he said. "If a very affluent city is devoid of poor residents, the median multiple will indicate the city is more affordable than it would be if, for example, some poor residents remained or moved in."

"This doesn't mean people shouldn't use the median multiple for cities or neighborhoods," he continued, "but it means they need to interpret it appropriately." For smaller geographies, the demographics of the population is "more highly dependent on housing costs," meaning the median multiple will usually overstate affordability for wealthy areas and understate the affordability of poorer places.

Read Michelle Robertson's latest stories and send her news tips at mrobertson@sfchronicle.com.

Start receiving breaking news emails on wildfires, civil emergencies, riots, national breaking news, Amber Alerts, weather emergencies, and other critical events with the SFGATE breaking news email. Click here to make sure you get the news.