Let M be the Shimura variety associated to the group of spinor similitudes of a quadratic space over Q of signature (n,2). We prove a conjecture of Bruinier and Yang, relating the arithmetic intersection multiplicities of special divisors and CM points on M to the central derivatives of certain L-functions. Each such L-function is the Rankin-Selberg convolution associated with a cusp form of half-integral weight n/2+1, and the weight n/2 theta series of a positive definite quadratic space of rank n. When n=1 the Shimura variety M is a classical quaternionic Shimura curve, and our result is a variant of the Gross-Zagier theorem on heights of Heegner points.