How is the cost of an impression determined?

The cost of ad impressions is determined in the course of the RTB auction based on the first and second price.