Let
\begin{align*}
\mathrm{d}S_t&=\mu S_t\mathrm{d}t+\sqrt{v_t}S_t\mathrm{d}B_{S,t}, \\
\mathrm{d}v_t&=\kappa(\bar{v}-v_t)\mathrm{d}t+\xi\sqrt{v_t}\mathrm{d}B_{v,t},
\end{align*}
where $\mathrm{d}B_{S,t}\mathrm{d}B_{v,t}=\rho\mathrm{d}t$.
The market price of risk (or Girsanov kernel or Sharpe ratio) is ${\varphi}_t=\left(\frac{\mu-r}{\sqrt{v_t}},\frac{\lambda \sqrt{v_t}}{\xi}\right)$. Then, Girsanov Theorem suggests
\begin{align*}
A_t=\frac{\mathrm{d}\mathbb Q}{\mathrm{d}\mathbb P}= \exp\bigg(&-\int_0^t \frac{\mu-r}{\sqrt{v_s}}\mathrm{d}B_{S,s} -\int_0^t \frac{\lambda\sqrt{v_s}}{\xi}\mathrm{d}B_{v,s} + \int_0^t \frac{ (\mu-r)\lambda\rho}{\xi}\mathrm{d}s\\
&-\frac{1}{2}\int_0^t \left(\frac{(\mu-r)^2}{v_s}+\frac{\lambda^2v_s}{\xi^2} \right)\mathrm{d}s\bigg).
\end{align*}
This process $A_t$ is a martingale and solves $\text{d}A_t=-\varphi_tA_t\text{d}\mathbf{B}_t$, where $\mathbf{B}_t=\left(B_{S,t},B_{v,t}\right)$.
The corresponding stochastic discount factor is $M_t=e^{-rt}A_t$.
In the one-dimensional case (Black-Scholes model), you have $\varphi_t=\frac{\mu-r}{\sigma}$ and
\begin{align*}
A_t=\frac{\mathrm{d}\mathbb Q}{\mathrm{d}\mathbb P}= \exp\bigg(- \frac{\mu-r}{\sigma}B_{t}-\frac{1}{2}\left(\frac{\mu-r}{\sigma}\right)^2 t\bigg).
\end{align*}