The ratings that you see are usually AM Best ratings. The company publishes several different kinds of ratings that are designed to measure "the creditworthiness of an issuer or debt obligation", i.e. how close the company is to insolvency, how financially stable it is, etc. In short, it's a rating of the financial strength of the company.
For most consumers, these ratings probably aren't anything more than a formality, since most major insurers are solid companies. Of course, these ratings break down when companies aren't estimating their potential for losses correctly, hence the bailout of AIG after its fiasco with credit default swaps.
The methodology AM Best uses is somewhat complex. They state that:
Our rating process involves a comprehensive quantitative and qualitative analysis of a company's balance sheet strength, operating performance and business profile. This includes comparisons to peers and industry standards as well as assessments of operating plans, philosophy and management.
I'm fairly certain that these ratings apply to all types of insurers, including re-insurers, as well as some of the securities they offer.
Standard and Poor's and Moody's also publish ratings of insurance companies, but AM Best is known for focusing almost exclusively on the insurance industry.
All of these ratings are financial strength ratings, however, which isn't necessarily indicative of how appropriate their products will be for you. I'm sure there are other ratings too, e.g. customer service ratings, that you could find somewhere, but I don't know of any specific ones off the top of my head. The financial strength of a company is more relevant when you buy a life insurance policy or an annuity, because you want the company to be viable for a long time. In this case, you should consider the financial strength ratings as part of your evaluation before purchasing such a policy.