We survey the literature analyzing the price formation and trading process, and the consequences of market organization for price discovery and welfare. We offer a synthesis of the theoretical microfoundations and empirical approaches. Within this framework, we confront adverse selection, inventory costs and market power theories to the evidence on transactions costs and price impact. Building on these results, we proceed to an equilibrium analysis of policy issues. We review the extent to which market frictions can be mitigated by such features of market design as the degree of transparency, the use of call auctions, the pricing grid, and the regulation of competition between liquidity suppliers or exchanges.