Pharmacy benefit managers (PBMs) play a central role in the U.S. market for prescription drugs, but are poorly understood and controversial. PBMs act as market intermediaries who operate drug formularies on behalf of payers and their activities are generally understood to produce lower prices and savings for their clients. Here we model PBMs as a common agent across payers and receive payments from branded 'on patent' drug makers for helping them sell their products to these consumers. The latter payments are called rebates and are calculated per unit sold and as a percentage of the drug's list price set by the drug maker. Rebates are a central focus of controversy; observers question whether rebates turn these common agents into 'double agents', furthering their own for profit interests at the expense of their payer clients and contributing to inflated branded drug prices. Our model is useful for identifying conditions under which PBMs greatly enhance market efficiency. The model also identifies conditions under whichPBMs threaten market efficiency. For example, we find that when PBMs are highly concentrated, these efficiency gains accrue to PBMs rather than consumers or drug makers. Our model offers a framework for understanding current market organization and evaluating proposed market reforms.