How much should society invest in medical care that extends the lives of the older generations? We derive a golden rule for the level of health care expenditures and find that the optimal level of life-extending health care expenditures should increase with rising productivity, increase with the retirement age, and also increase with the population growth rate if a higher growth rate lowers the ratio of retirees to working-age people sufficiently, while the effects of an improvement in medical technology are ambiguous. Moreover, we find that a market economy may be inefficient in terms of the provision of life-extending health care because an individual ignores the effect of his own longevity on the income of others