Solution (source code)

= Solution

Put $\tau=T_r\wedge T_R$. First establish almost sure finiteness. The <Itô formula> gives the <martingale> $|B_t|^2-2t$ for planar <Brownian motion>. Stop it at $t\wedge T_R$. The stopped path has norm at most $R$, so
$$
2\mathbb E(t\wedge T_R)=\mathbb E|B_{t\wedge T_R}|^2-|x|^2\leq R^2-|x|^2.
$$
By <monotone convergence>, $\mathbb E T_R<\infty$, and hence $\tau<\infty$ almost surely.

The function $h(y)=\log|y|$ is a <harmonic function> away from $0$: in polar coordinates its <Laplacian> is $h''(\rho)+h'(\rho)/\rho=-\rho^{-2}+\rho^{-2}=0$. The <Itô formula> shows $h(B_{t\wedge\tau})$ is a <local martingale>. It is bounded between $\log r$ and $\log R$, so it is a true <martingale> and passage to $\tau$ is justified by <dominated convergence>. Writing $p=\mathbb P_x(T_r<T_R)$ and using continuity at exit gives
$$
\log|x|=\mathbb E_x\log|B_\tau|=p\log r+(1-p)\log R.
$$
Solving yields the <planar Brownian annulus hitting probability>
$$
\boxed{\mathbb P_x(T_r<T_R)=\frac{\log R-\log|x|}{\log R-\log r}.}
$$
The stopping argument stays away from the singularity of the logarithm until the calculation is complete.