A rigid analytic Gross-Zagier formula and arithmetic applications