Numéraire Change
The time-$t$ price of a zero-coupon bond maturing at time $T$ is
$$P(t,T)=\mathbb{E}^\mathbb{Q}_t\left[\exp\left(-\int_t^T r_s\text{d}s\right)\right].$$
Let $\mathbb{Q}$ be our standard risk-neutral probability measure which uses a locally risk-free bank account, $\text dB_t=r_tB_t\text dt$, as numéraire. From Geman et al. (1995), we know
\begin{align}
\frac{\text d\mathbb Q^T}{\text d\mathbb Q}\Bigg|_{\mathcal{F}_t}=\frac{P(T,T)}{P(t,T)}\frac{B_t}{B_T}=\frac{1}{P(t,T)}\frac{B_t}{B_T}.
\end{align}
Then, the forward price $\frac{S_t}{P(t,T)}$ is a $\mathbb{Q}^T$-martingale, i.e.
\begin{align*}
S_t = P(t,T)\mathbb{E}^{\mathbb{Q}^T}_t[S_T].
\end{align*}
When interest rates are deterministic, $\mathbb{Q}=\mathbb{Q}^T$ and, as always, $$ S_t=e^{-r(T-t)}\mathbb{E}^\mathbb{Q}_t[S_T].$$
For an equivalent probability measure which uses the (reinvested) stock as numéraire, we get
\begin{align}
\frac{\text d\mathbb{Q}^S}{\text d\mathbb Q}\Bigg|_{\mathcal{F}_t}=\frac{S_Te^{qT}}{S_te^{qt}}\frac{B_t}{B_T}.
\end{align}
Option Pricing
The initial value of a call option is thus
\begin{align*}
\text{Call}(S_0;K,T)&=\mathbb{E}^\mathbb{Q}_0\left[\frac{B_0}{B_T}\max\{S_T-K,0\}\right] \\
&= \mathbb{E}^\mathbb{Q}_0\left[\frac{B_0}{B_T}S_T\mathrm{1}_{\{S_T\geq K\}}\right]-K\mathbb{E}^\mathbb{Q}_0\left[\frac{B_0}{B_T}\mathrm{1}_{\{S_T\geq K\}}\right] \\
&= S_0e^{-qT}\mathbb{E}^{\mathbb{Q}^S}_0\left[\mathrm{1}_{\{S_T\geq K\}}\right]-KP(0,T)\mathbb{E}^{\mathbb{Q}^T}_0\left[\mathrm{1}_{\{S_T\geq K\}}\right] \\
&= S_0e^{-qT}\mathbb{Q}^S\left[\left\{S_T\geq K\right\}\right]-KP(0,T)\mathbb{Q}^T\left[\left\{S_T\geq K\right\}\right].
\end{align*}
This is Theorem 2 in Geman et al. (1995) and beautifully decomposes option prices into two exercise probabilities. Note that we made no assumptions about the distribution of the stock price. Assuming constant interest rates and normally distributed stock returns nests the Black and Scholes (1973) formula.