Let M be the Shimura variety associated with the group of spinor similitudes of a rational quadratic space over of signature (n,2). We prove a conjecture of Bruinier-Kudla-Yang, relating the arithmetic intersection multiplicities of special divisors and big CM points on M to the central derivatives of certain L-functions. As an application of this result, we prove an averaged version of Colmez's conjecture on the Faltings heights of CM abelian varieties.