To get horizontal coordinates of the centers of the circles/spheres (1) Accumulate the diameters of circles/spheres in odd and even positions separately, (2) shift the second list by an arbitrary amount ( byby the average of the horizontal positions the two leftmost circles/spheres below) and, (3) riffle the two lists to getand (4) subtract the centersradii from the resulting list:
SeedRandom[1]
randomradii = RandomSample[Range @ 20, 10];
centers = Module[{origins = {0, Mean[Sort[#][[{1, 2}]]]}}, Riffle @@
(Function[x, origins[[x]] + Accumulate[2 #[[x ;; ;; 2]]]] /@ {1, 2})] - #] &@ randomradii;
Graphics[MapIndexed[{Thick, ColorData[97]@#2[[1]],
Circle[{centers[[#2[[1]]]] - #, 0}, #]} &, randomradii]]
Graphics3D[MapIndexed[{Opacity[.5], ColorData[97]@#2[[1]],
Sphere[{centers[[#2[[1]]]] - #, 0, 0}, #]} &, randomradii],
Boxed -> False, ViewPoint -> Front]