To explain the puzzle that fiscal policy is often procyclical in emerging and developing countries (i.e., fiscal policy is expansionary in good times and contractionary in bad times), we develop a model for the optimal behavior of government spending and tax rates over the business cycle. Our set-up relies on financial frictions, which have been shown to be critical features of emerging markets, captured by various degrees of asset market incompleteness as well as varying levels of debt elasticities of real interest rates. We first uncover a novel theoretical result within a simple static framework: incomplete markets can explain procyclical government spending but not necessarily procycical tax policy. Proyclical tax policy requires that the ratio of private to public consumption comoves positively with the business cycle. The procyclicality of tax policy holds in a more realistic, dynamic, general equilibrium model calibrated to emerging markets. Further, we show how larger financial frictions, which amplify the business cycle through more procyclical fiscal policies, have sizeable welfare costs.