This paper presents applications of stochastic control theory in determining an insurer's optimal reinsurance and rating policy. Optimality is defined by means of variances of such variables as underwriting result of the insurer, solvency margins of the insurer and reinsurer and the premiums paid by policyholders.