This paper develops a tractable general equilibrium with endogenous firm capital structure decisions driven by changes in economic uncertainty. The model enables a critical assessment of standard paradigms of corporate finance in order to highlight empirically important directions for improvement, and help understand potential real effects. The standard trade-off version of the model implies that debt incentives contract with risk. Yet, surprisingly, aggregate and firm-level evidence shows that leverage increases with uncertainty. This effect is driven by debt quantities, and is not due to the leverage denominator. It is also not explained by precautionary cash hoarding, binding restructuring constraints, or capital supply frictions. The analysis thus points towards alternative formulations in which debt incentives increase with risk. A version of the model with moral hazard via default insurance can account for the joint dynamics of uncertainty, credit spreads, and debt. In this version, unlike the trade-off case, the real effects of debt can become severely negative.