How to implement Constructive Solid Geometry in ray tracing with implicit surfaces (spheres)?
I'm not sure what exactly you are asking but, IIRC, to do CSG with ray tracing, you maintain not just the closest intersection with an object, but a list of ordered pairs of [Inpoint, OutPoint] 'interval' distances. With a single sphere test (or any solid convex primitive for that matter), this list would have at most one [Inpoint, OutPoint] entry or is empty if there is a miss.

To implement CSG you then apply the binary operator to a pair of lists, which in turn means applying them to the entries in the lists in a manner akin to merge-sorting two lists. 

For example, for intersection, if you had  [a,b] in one list and [c,d] in the other, compute  e=Max(a,c) f=Min(b,d).  If e > f there's no intersection else return the intersection, [e,f].

Does that help?