I evaluate how the probability of substitution of a prescribed drug in a pharmacy depends on the pharmacists' profits and patients' out of pocket costs. I use Finnish population-wide data covering all prescriptions of three popular antidepressants. I find that one euro increase in the total markup difference between the prescribed drug and its cheapest available substitute is associated with 1.7 percentage points decrease in the probability of substitution. This result is driven by brand-name drugs. An increase in the patients' out of pocket cost differential yields a 0.6 percentage points increase in the probability of accepting the substitution. My findings offer novel evidence that pharmacists' incentives are instrumental for prescription drug cost savings and overall cost effectiveness of the health care system.