For stocks and bonds, the Spread is the difference between what sellers are asking and what bidders are willing to pay.
If the bid price for a stock is $10, that is what someone is willing to pay for each share. At the same time, the per-share ask price could be $12. The spread is therefore $2. If you put in a market order to immediately buy 1,000 shares of the stock, you have to pay the ask price. (A market order doesn't specify a price.) If you put in an order to immediately sell 1,000 shares, you have to take the bid price.
In stock markets, bidders and askers can be paired up by computers or by broker/specialists who are out on the actual floor. These matchmakers profit because of the spread. In the above example, because the orders specify an immediate transaction, the buyer must pay the ask price of $12 each for 1,000 shares, costing $12,000. But the seller has agreed to sell them at the bid price of $10 each, or $10,000. The difference, the spread, in this transaction is $2,000, and it goes to the middleman.
The bid-ask spread is a function of supply and demand. If something other than a market order is placed, there will be price specifications or time specifications that don't bind investors to the bid/ask prices that exist when the order is placed. This allows more of the give-and-take of trading/compromising/dickering.