The "price" is the price of the last transaction that actually took place.
According to Motley Fool wiki:
A stock price is determined by what was last paid for it. During market hours (usually weekdays from 9:30AM-4:00PM eastern), a heavily traded issue will see its price change several times per second. A stock's price is, for many purposes, considered unchanged outside of market hours.
Roughly speaking, a transaction is executed when an offer to buy matches an offer to sell.
These offers are listed in the Order Book for a stock (Example: GOOG at Yahoo Finance). This is actively updated during trading hours.
This lists all the currently active buy ("bid") and sell ("ask") orders for a stock, and looks like this:
You'll notice that the stock price (again, the last sale price) will (usually*) be between the highest bid and the lowest ask price.
* Exception: When all the buy or sell prices have moved down or up, but no trades have executed yet.