This article relates corporate credit rating quality to competition in lending between the public bond market and banks. In the model, the monopolistic rating agency's choice of price and quality leads to an endogenous threshold separating low-quality bank-dependent issuers from higher-quality issuers with access to public debt. In a baseline equilibrium with expensive bank lending, this separation across debt market segments provides information, but equilibrium ratings are uninformative. A positive shock to private (bank) relative to public lending supply allows banks to compete with public lenders for high-quality issuers, which threatens rating agency profits, and informative ratings result to prevent defection of high-quality borrowers to banks. This prediction is tested by analyzing two events that increased the relative supply of private vs. public lending sharply: legislation in 1994 that reduced barriers to interstate bank lending and the temporary shutdown of the high-yield bond market in 1989. After each event, the quality of ratings (based on their impact on bond yield spreads) increased for affected issuers. The analysis suggests that strategic behavior by the rating agency in an issuer-pays setting dampens the influence of macroeconomic shocks, and explains the use of informative unsolicited credit ratings to prevent unrated bond issues, particularly during good times. Additionally, the controversial issuer-pays model of ratings leads to more efficient outcomes than investor-pays alternatives.