This paper examines the dynamics of financial distress and in particular the mechanism of transmission of shocks from the financial sector to the real economy. The analysis is performed by representing the linkages between microeconomic financial variables and the aggregate performance of the economy by means of a microfounded model with firms that have heterogeneous capital structures. The model is solved both numerically and analytically, by means of a stochastic approximation that is able to replicate quite well the numerical solution. These methodologies, by overcoming the restrictions imposed by the traditional microfounded approach, enable us to provide some insights into the stabilization policies which may be effective in a financially fragile system.