This paper introduces endogenous technological change in a Hotelling-Herfindahl model of natural resource use to study the recent developments in the U.S. natural gas industry. We consider optimal forward-looking technology investments, and study implications for the order of extraction of conventional and shale gas, and a backstop technology, and characterize the development of gas prices. We find that technology investments increase during the extraction of conventional gas. Once production shifts towards shale gas, investments decline. Consistent with current trends, our theory explains how gas prices can follow a U-shaped path. The calibrated model suggests that U.S. shale gas production continues to grow and prices continue to decrease until 2050. We analytically and numerically show that the introduction of a carbon tax would reduce technology investments, and thus could drastically change the temporal patterns of U.S. shale gas extraction. The forward-looking behaviour of firms is crucial for such an effect, which does not occur in models that treat the improvement in extraction technology as an unanticipated shock to the industry.