A retailer following a competition-based dynamic pricing strategy tracks competitors' price changes and then must answer the following questions: (1) Should the retailer respond? (2) If so, respond to whom? (3) How much of a response? (4) And on which products? The answers require unbiased measures of price elasticity as well as accurate knowledge of competitor significance and the extent to which consumers compare prices across retailers. To quantify these factors empirically, there are two key challenges: first, the endogeneity associated with almost any type of observational data, where prices are correlated with demand shocks observable to pricing managers but not to researchers; and second, the absence of competitor sales information, which prevents efficient estimation of a full consumer-choice model. We address the first issue by conducting a field experiment with randomized prices. We resolve the second issue by proposing an identification strategy that exploits the retailer's own and competitors' stock-outs as a valid source of variation to the consumer choice set. We estimate an empirical model capturing consumer choices among substitutable products from multiple retailers. Based on the estimates, we propose a best-response pricing strategy that takes into account consumer choice behavior, competitors' actions, and supply parameters (procurement costs, margin target, and manufacturer price restrictions). We test our algorithm through a carefully controlled live experiment that lasts for five weeks. The experiment documents an 11 percent revenue increase, while maintaining margin above a retailer specified target.