We identify the optimal contract between a rating agency and a firm and the circumstances under which simple ownership contracts implement this optimal solution. We assume that the decision to obtain a rating is endogenous and the price of a rating is a strategic variable. Clients hiding their ratings can be an equilibrium only if they are ex ante uncertain of their quality and if the hiring decision is not observable. For some distribution functions, a competitive rating market is necessary for this result to obtain. In this context, competition between rating intermediaries will lead to less information in equilibrium.