The long-term average rule of thumb is that houses should be priced at about 13 to 15 times the annual rent (a gross yield of roughly 7%). Anything above that means houses are expensive to buy, and you should prefer to rent (conversely, below that level, you should start to look at buying).
A few interesting little data points: you’re mostly better off renting in SF, except in the ultra-expensive Nob Hill and Marina districts. Miami, on the other hand, is a sea of blue, even out on Miami Beach. I think this may be an artefact of the housing bubble - purchase prices plunged 12 to 18 months ago, but rents are only now starting to fall as the supply glut hits the market - but if you need to live in Miami, you’re definitely a lot better off buying than renting.