  We study the heating rate of r-process nuclei and thermalization of decay
products in neutron star merger ejecta and macronova (kilonova) light curves.
Thermalization of charged decay products, i.e., electrons, $\alpha$-particles,
and fission fragments is calculated according to their injection energy. The
$\gamma$-ray thermalization processes are also properly calculated by taking
the $\gamma$-ray spectrum of each decay into account. We show that the
$\beta$-decay heating rate at later times approaches a power-law decline as
$\propto t^{-2.8}$, which agrees with the result of Waxman et al. (2019). We
present a new analytic model to calculate macronova light curves, in which the
density structure of the ejecta is accounted for. We demonstrate that the
observed bolometric light curve and temperature evolution of the macronova
associated with GW170817 are reproduced well by the $\beta$-decay heating rate
with the solar r-process abundance pattern. We interpret the break in the
observed bolometric light curve around a week as a result of the diffusion wave
crossing a significant part of the ejecta rather than a thermalization break.
We also show that the time-weighted integral of the bolometric light curve
(Katz integral) is useful to provide an estimate of the total r-process mass
from the observed data, which is independent of the highly uncertain radiative
transfer. For the macronova in GW170817, the ejecta mass is robustly estimated
as $\approx 0.05M_{\odot}$ for $A_{\rm min}\leq 72$ and $85\leq A_{\rm min}\leq
130$ with the solar r-process abundance pattern. The code for computation of
the heating rate and light curve for given initial nuclear abundances is
publicly available.
