Bonds with credit risk have to pay a credit risk premium, called the credit spread, which is the difference in yield between a risky bond and a risk free bond with the same maturity.
Required rate of return for credit risky bonds = R + π + θ + γ
γ = additional risk premium for credit risk = credit spread
This spread will rise during economic downturns as defaults increase and conversely will decrease during economic booms.
In narrow spread situations, credit bonds outperform risk free bonds, and lower rated bonds will benefit more from narrower credit spreads, as their yields fall more, leading to bigger price increases.
Conversely, when credit spreads widen, higher rated bonds will outperform lower rated bonds on a relative basis as their prices will drop less.