  Let $X\to B$ be a proper flat morphism between smooth quasi-projective
varieties of relative dimension $n$, and $L\to X$ a line bundle which is ample
on the fibers. We establish formulas for the first two terms in the
Knudsen-Mumford expansion for $\det (\pi_* L^k)$ in terms of Deligne pairings
of $L$ and the relative canonical bundle $K$. This generalizes a theorem of
Deligne which holds for families of relative dimension one. As a corollary, we
show that when $X$ is smooth (or, more generally, if $X$ fits in a smooth
family), the line bundle associated to $X\to B$, which was introduced by the
first and third authors, coincides with the CM bundle defined by Paul-Tian. In
a second corollary, we establish asymptotics for the K-energy along Bergman
rays, generalizing a formula obtained by Paul-Tian.
