Risk management

What is the primary role of a credit rating in debt markets?