Solution (source code)

= Solution

Let $\tau_r=\inf\{t\geq0:|B_t|=r\}$, $\tau_R=\inf\{t\geq0:|B_t|=R\}$, and $\tau=\tau_r\wedge\tau_R$. The function $u(y)=|y|^{-1}$ is harmonic away from the origin: its <radial Laplacian> in dimension three is
$$
u''(\rho)+\frac2\rho u'(\rho)=\frac2{\rho^3}-\frac2{\rho^3}=0.
$$
The <Itô formula> therefore makes $u(B_{t\wedge\tau})$ a <local martingale>, bounded between $1/R$ and $1/r$, hence a true <martingale>. The annulus exit time is finite <almost surely>. For instance, exit from the containing <open ball> is finite because from every point in the <open ball> a sufficiently large <Gaussian vector> increment has a uniform positive probability of leaving it in unit time; iterate the <geometric tail bound from a uniform escape probability>.

The <optional stopping theorem> at $t\wedge\tau$, followed by the <dominated convergence theorem>, gives $\mathbb Eu(B_\tau)=u(x)$. By continuity, there is no radial overshoot and the two exit <spheres> cannot be hit simultaneously. Writing $p=\mathbb P_x(\tau_r<\tau_R)$ gives
$$
\frac1{|x|}=\frac pr+\frac{1-p}{R},\qquad
\boxed{p=\frac{|x|^{-1}-R^{-1}}{r^{-1}-R^{-1}}.}
$$
All harmonicity and boundedness statements apply only in the annulus, which stays away from the singularity at zero.