What is the optimal policy response to a negative sectoral shock? How do frictions in goods and labor markets affect the nature and speed of the process of reallocating resources across alternative uses? Should government controlled inputs be allocated to compensate for frictions faced by the private sector or, rather, should they be deployed to complement private sector decisions? In this paper we make a first attempt to understand what features of an economy determine the answers to the previous questions. We study a model in which the drop in the private demand for structures frees up resources that can be used to produce government capital. For a reasonable calibration, we find that government spending increases in response to the drop in private demand, but that the size of the increase is inversely related to the level of frictions: the 1 larger the costs that the economy faces to reallocate resources (capital and labor) across sectors, the smaller the optimal level of government spending.