Just because Facebook and Google both make money by selling advertisements doesn't mean they are in the same market.
For example, Google makes so much money from advertising because they can show users ads pertinent to their search query at the point they are often making a buying decision.
However, Facebook users are on the site because they bored or communicating and not even considering buying something. Not to mention that a large portion of Facebook users have very little discretionary spending money or ability to purchase online anyway.
The market and motivation involved between the two companies is completely different and not comparable.
In December 2009, Facebook repurchased shares at $25 for an implied valuation of $11 billion. That's a 55 P/E.