The payment approach known as “pay-for-performance” has been widely adopted with the aim of improving the quality of health care. Nonetheless, little is known about how to use the approach most effectively to improve care. We examined the effects in 260 hospitals of a pay-for-performance demonstration project carried out by the Centers for Medicare and Medicaid Services in partnership with Premier Inc., a nationwide hospital system. We compared these results to those of a control group of 780 hospitals not in the demonstration project. The performance of the hospitals in the project initially improved more than the performance of the control group: More than half of the pay-for performance hospitals achieved high performance scores, compared to fewer than a third of the control hospitals. However, after five years, the two groups’ scores were virtually identical. Improvements were largest among hospitals that were eligible for larger bonuses, were well financed, or operated in less competitive markets. These findings suggest that tailoring pay-for-performance programs to hospitals’ specific situations could have the greatest effect on health care quality.