
I'm going to assume $r_2>r_1$, as in my diagram. I haven't checked to see whether this is necessary for the rest of my work or not. This might get confusing, so let me start with a rough outline. $PX_2C_2I_2$ is a quadrilateral with right angles at $X_2$ and $I_2$ and the desired angle is the interior angle of this quadrilateral at $P$. I'm going to find the measure of the internal angle at $C_2$ by finding the measures of $\angle I_2C_2C_1$ and $\angle X_2C_2C_1$.
Let's start with $\angle X_2C_2C_1$. Consider $\triangle C_1C_2R_x$. It has a right angle at $R_x$, $C_1C_2=d$, and $C_2R_x=r_2-r_1$, so $\cos(\angle X_2C_2C_1)=\frac{C_2R_x}{C_1C_2}=\frac{r_2-r_1}{d}$ and $\angle X_2C_2C_1=\arccos\left(\frac{r_2-r_1}{d}\right).$
Now, turn to $\triangle C_1C_2R_i$. It has right angle at $R_i$, $C_1C_2=d$, and $C_2R_i=r_1+r_2$, so $\cos(\angle I_2C_2C_1)=\frac{C_2R_i}{C_1C_2}=\frac{r_1+r_2}{d}$ and $\angle I_2C_2C_1=\arccos\left(\frac{r_1+r_2}{d}\right).$
Thus, $\angle X_2C_2I_2=\arccos\left(\frac{r_2-r_1}{d}\right)+\arccos\left(\frac{r_1+r_2}{d}\right)$ and $\angle X_2PI_2=180°-\arccos\left(\frac{r_2-r_1}{d}\right)-\arccos\left(\frac{r_1+r_2}{d}\right).$