A market order is a type of brokerage order that guarantees execution but doesn't guarantee the price you get for your buy/sell. If you place a market order you will continue to buy or sell shares until your order is filled regardless of price.
A market for a stock is created by a number of sellers listing a price they are willing to sell at (ask price) and buyers listing the price they are willing buy at (bid price). An exchange typically lists the best ask price and best bid price. If you are interested in selling a stock the price of the stock is the best bid price while if you are looking to buy a stock the price of the stock is the best ask price.
When a market order is placed you begin buying or selling at the best price and continue buying or selling until your order is filled. You are not guarenteed to get the best ask price or best bid price for every share of stock you buy or sell.
A market order authorizes the specialist to trade against you for his own account to fill your order in a timely fashion. Usually the order will fill at the bid/ask price opposite your order if the quantity available is sufficient. In the case of a thinly traded stock, the price spike that results from a market order can be significant. For that reason many recommend the use of a limit order when practical to trade stocks.