As foreclosures continue to rise, regulators and others are questioning the role of credit agencies, which gave top ratings to risky mortgage-backed securities. Critics say the system, in which firms are paid by the companies they rate, is inherently flawed.