We study the Rankin $L$-series of a cuspidal automorphic representation of GL(2) of even weight over the rational numbers, twisted by a character of a real quadratic field. When the sign of the functional equation is <formula form="inline" disc="math" id="ffm004"><formtex notation="AMSTeX">$+1$, we give an explicit formula for the central value of the $L$-series, analogous to the formulae obtained by Gross, Zhang, and Xue in the imaginary case. The proof uses a version of the Rankin–Selberg method in which the theta correspondence plays an important role. We give two applications, to computing the order of the Tate–Shafarevich group of the base change to a real quadratic field of an elliptic curve defined over the rationals, and to proving the equidistribution of individual closed geodesics on modular curves.