Here is a cool video with Hal Varion Google Chief Economist that gives you a detailed inside look at how Google ranks your Adwords ads. This is killer stuff that can help if you run Pay Per Click (PPC) Campaigns.
Google Ad Auction
Essentially there are 3 parties involved in an Adwords campaign.