If you move around alot, i'd guess you're better off renting. But if you intend to stay put, buying might be better. Still, there are an awful lot of variables and no set-in-stone gospel about it.
To use one example, I bought my condo back in late 1994 for $84,500. If I needed to rent it out, I probably could've gotten around $800 per month, if I was lucky. At the time, my mortgage + condo fee came out to around $930 per month (I was young, so they hit me with a high interest rate) Well, by 2002 it might've been worth $110-120K. By that time I could've gotten around $1200 per month for it. So in 8 years, the value went up 30-42%, while the rent would have gone up 50%. By this time I had refinanced to a lower rate, so my mortgage was less. Condo fee had shot up though, so combined it was around $750 per month.
But then when I sold it in late 2004, almost 10 years to the day from when I purchased it, I got $185K for it. Still probably would've rented for around $1200. By this time I had refinanced again, to a 15 year mortgage. And my condo fee had really shot up, so my total payment was around $915 per month. So my monthly outlay was still a bit less than what it had been 10 years before. However, the guy that bought it financed 100% of it. I figure that if he was paying a 6% average (he did two loans, an 80/20 thing), that's $1100 per month just for the payment. Property taxes were still cheap, maybe $80 per month. Condo fee was up to $238.61 per month though (about double from when I moved in back in 1994) So I figure he's paying around $1400-1500 per month
Nowadays I'd say that condo would go for around $230-250K, but would still rent for maybe $1200-1300 per month.