Treatment for depression is complex, requiring decisions that may involve tradeoffs between exploiting treatments with the highest expected value or experimenting with treatments with higher possible payoffs. Using patient claims data, we show that among skilled doctors, using a broader portfolio of drugs predicts better patient outcomes, except in cases where doctor’s decisions violate loose professional guidelines. We introduce a behavioral model of decision making guided by our empirical observations. The model’s novel feature is that the tradeoff between exploitation and experimentation depends on the doctor’s diagnostic skill. The model predicts that higher diagnostic skill leads to greater diversity in drug choice and better matching of drugs to patients even among doctors with the same initial beliefs regarding drug effectiveness. Consistent with the finding that guideline violations predict poorer patient outcomes, simulations of the model suggest that increasing the number of possible drug choices can lower performance.