Paying insurers risk-adjusted prices for covering different individuals can correct selection incentives and induce the market to provide optimal insurance policies. To calculate the optimal risk-adjusted prices we need to know (a) what the optimal policies are; (b) how much they cost; and (c) how competitive the market is. We examine these issues in a model with spatial heterogeneity and adverse selection. Market equilibrium is characterized, and delivery of the socially optimal insurance policies is possible, as long as providers are paid risk-adjusted fees for each individual they serve. When the payment can be made on the basis of an individual's risk, it should be sufficient to cover the expected cost of the socially optimal policy for that person, plus a mark-up. If payments can be made only on the basis of a partially informative signal, the optimal risk-based payments should be adjusted according to a simple linear transformation, identified by Glazer and McGuire [Glazer, J., McGuire, T., 2000. Optimal risk adjustment of health insurance premiums: an application to managed care. American Economic Review 90 (4), 1055-1071].