I use a New Keynesian model modified to allow for defaults à la Townsend (1979) in order to study the effect of monetary policy on the probability that firms default on loans. I argue that an expansionary monetary policy generates two opposing effects on defaults. A monetary expansion decreases defaults on existing loans by boosting firms' revenues through an increase in aggregate demand. However, it increases defaults on new loans because firms take on more leverage in subsequent periods in order to benefit from the lower cost of borrowing. The results of the paper are consistent with the empirical evidence from the ``risk taking channel of monetary policy'', in particular with Jimenez et al. (2007) and Piffer (2014). Comparative statics predict that the effect on defaults is reduced if the central bank reacts more aggressively to inflation and output, as this stronger reaction limits the decrease in the cost of debt and reduces the increase in leverage.