Patients rely on physicians to act as their agents when prescribing medications, yet the efforts of pharmaceutical manufacturers and prescription drug insurers may alter this agency relationship. We evaluate how formularies, and the use of information technology (IT) that provides physicians with formulary information, influence prescribing. We combine data from a randomized experiment of physicians with secondary data to eliminate bias due to patient, physician, drug, and insurance characteristics. We find that when given formulary IT, physicians' prescribing decisions are influenced by formularies far more than by pharmaceutical firms' detailing and sampling. Without IT, however, formularies' effects are much smaller.