An exact valuation formula for defaultable corporate coupon bonds is proved. The model incorporates discrete coupons, bankruptcy costs, taxes and the market risk generated by a stochastic risk-free structure. The aim of this paper is twofold: first, we generalise previous pricing models for corporate bonds; second, we provide a comprehensive formula in order to properly disentangle the contribution of several risk factors to credit spreads.Asset pricing, Coupon bonds, Credit risk, Debt valuation, Default risk, Structural models,