Health-care slows the natural growth of mortality, indirectly increasing utility from consumption through longer lifetimes. This paper solves the problem of optimal dynamic consumption and healthcare spending with isoelastic utility, when natural mortality grows exponentially to reflect the Gompertz' law. Optimal consumption and healthcare imply an endogenous mortality law that is asymptotically exponential in the old-age limit, with lower growth rate than natural mortality. Health spending steadily increases with age, both in absolute terms and relative to total spending. Differential access to healthcare with isoelastic effects can account for observed longevity gains across cohorts.