Throughout the current COVID-19 pandemic, governments have implemented a variety of containment measures, ranging from hoping for herd immunity (which is essentially no containment) to mandating complete lockdown. On the one hand, containment measures reduce lives lost by limiting the disease spread and controlling the load on the healthcare system. On the other hand, such measures slow down economic activity, leading to lost jobs, economic stall, and societal disturbances, such as protests, civil disobedience, and increases in domestic violence. Hence, determining the right set of containment measures is a key social, economic, and political decision for policymakers. In this paper, we provide a model for dynamically managing the level of disease containment measures over the course of a pandemic. We determine the timing and level of containment measures to minimize the impact of a pandemic on economic activity and lives lost, subject to healthcare capacity and stochastic disease evolution dynamics. On the basis of practical evidence, we examine two common classes of containment policies-dynamic and static-and we find that dynamic policies are particularly valuable when the rate of disease spread is low, recovery takes longer, and the healthcare capacity is limited. Our work reveals a fundamental relationship between the structure of Pareto-efficient containment measures (in terms of lives lost and economic activity) and key disease and economic parameters such as disease infection rate, recovery rate, and healthcare capacity. We also analyze the impact of virus mutation and vaccination on containment decisions.