Exploiting a rich panel data set on anti‐ulcer drug prescriptions, we measure the effects of uncertainty and learning in the demand for pharmaceutical drugs. We estimate a dynamic matching model of demand under uncertainty in which patients learn from prescription experience about the effectiveness of alternative drugs. Unlike previous models, we allow drugs to have distinct symptomatic and curative effects, and endogenize treatment length by allowing drug choices to affect patients' underlying probability of recovery. We find that drugs' rankings along these dimensions differ, with high symptomatic effects for drugs with the highest market shares and high curative effects for drugs with the greatest medical efficacy. Our results also indicate that while there is substantial heterogeneity in drug efficacy across patients, learning enables patients and their doctors to dramatically reduce the costs of uncertainty in pharmaceutical markets.