This paper investigates the optimal environmental policy (the mix of emissions tax and research and development [R&D] subsidy) in a dynamic setting when two firms, producing differentiated products, compete in the output market over time. Firms compete in a differential game setting over supply schedules, which encompasses a continuum of imperfect competition equilibria from Bertrand to Cournot. Although production generates environmentally damaging emissions, firms can undertake R&D that has the sole purpose of reducing emissions. In addition to characterizing the optimal policy, we examine how the optimal tax and subsidy, and the optimal level of abatement, change as competition intensifies, as the dynamic parameters change, and as the investment in abatement technology changes. In this setting, competition increases welfare through its impact on the final goods price. However, lower prices result in larger quantities and more pollution. Our key contribution is to show how the impact of increased competition on welfare depends on the extent of the market and the nature of preferences and technology.