google is a big geek in online market... they are getting money from adwords and adsense... if you know more about google financial and earnings at http://investor.google.com/earnings/2010/Q2_google_earnings.html let me know if you need more help on this...
Google earns it's money in a wide range of ways but primarily through advertising systems. It keeps a large proportion of advertising revenue and then pays a small percentage to affiliates.
I'd think Google(or small companies under it) also offers an IT consulting service for other big company.