
Note that $C$ belongs to the segment $\overline{AQ}$ since both $\overline{AQ}$ and $\overline{CQ}$ must be perpendicular to the tangent line at $Q$. By a similar argument, $C$ belongs to the segment $\overline{BP}$.
Therefore,
$$
\overline{AC} = \overline{AQ} - \overline{CQ} = r_A - r_C
\qquad\mbox{and}\qquad
\overline{BC} = \overline{BP} - \overline{CP} = r_B - r_C
$$
and $C$ is the intersection of two circles, one centred at $A$ with radius $\overline{AC}$, and another, centred at $B$ with radius $\overline{BC}$:
(Note: I'm using $\overline{X}$ to represent both the segment $X$ and its length)
$$
(x_C-x_A)^2 + (y_C-y_A)^2 = (r_A - r_C)^2
$$
$$
(x_C-x_B)^2 + (y_C-y_B)^2 = (r_B - r_C)^2
$$
These two equations can be solved for $(x_C,y_C)$. There will be, in general, two solutions. Choose either, as the other is mirrored with respect to $\overline{AB}$.
Once you have $(x_C,y_C)$, construct the unit vectors
$$
\hat{u} = \frac{C-A}{\overline{AC}}
$$
$$
\hat{v} = \frac{C-B}{\overline{BC}}
$$
Then,
$$
Q = r_A\,\hat{u}
$$
$$
P = r_B\,\hat{v}
$$