We review the last two decades of research in dynamic corporate finance, focusing on capital structure and the financing of investment. We first cover continuous time contingent claims models, starting with real options models, and working through static and dynamic capital structure models. We then move on to corporate financing models based on discrete-time dynamic investment problems. We cover the basic model with no financing, as well as more elaborate models that include features such as costly external finance, cash holding, and both safe and risky debt. For all the models, we offer a minimalist, simplified presentation with a great deal of intuition. Throughout this survey, we show how these models can answer questions concerning the effects of finance constraints on investment, the level of corporate leverage, the speed of adjustment of leverage to its target, and market timing, among others. Finally, we review and explain structural estimation of corporate finance models.