Facebook was widely reported as having an IPO price of $38. Yet, all the stock charts show Facebook shares priced at $42 until around 11:30 AM, than dropping to $40, and then only at 11:50 AM beginning to trade at $38. Why the initial higher prices?
I'd add, this is actually the way any stock opens every day, i.e. the closing price of the prior day is what it is, but the opening price will reflect whatever news there was prior to the day's open. If you watch the business news, you'll often see that some stock has an order imbalance and has not opened yet, at the normal time. So, as Geo stated, those who were sold shares at the IPO price paid $38, but then the stock could open at whatever price was the point where bid and ask balanced.
I snapped a screen capture of this chart on the first day of trading, the daily charts aren't archived where I can find them. This is from Yahoo Finance. You can see the $42 open from those who simply wanted in but couldn't wait, the willingness of sellers to grab their profit right back to what they paid, and then another wave of buying, but then a sell-off. It closed virtually unchanged from the IPO price.
The IPO price is set between the underwriters and the specialist in the NASDAQ. There are a lot of complexities on how to get to this price, everyone is trying to pull to their own side. In the Facebook example, the price was $38 for all IPO participants. Then, once the IPO went to the secondary market, the bid/ask drove the pricing.
At the secondary market the price is driven by the demand and offer of the stock. That is, people who wanted to buy right after the IPO likely drove the initial price up.