Set line PQ to be the x-axis (just for visualization, not going to use coordinate bashing).
The point of tangency on circle P is F, and the point of tangency on circle Q is S.
PQ has length 18. PF is the radius, so it has length 10, and QS is the radius, so it has length 8.
Let the point of intersection between line PQ and line FS be O.
Let QO = x (looking for x).
PF is perpendicular to FS is perpendicular to QS. So we have similar triangles OQS and OPF.
Similar triangles: x/(x + 18) = 8/10
10x = 8x + 144
QR = 72