How to implement Constructive Solid Geometry in ray tracing with implicit surfaces (spheres)? What I'm trying to do is to simulate refraction through biconcave lens described by spheres A, B, C where C is a sphere in between A and B. So far I've gathered that a good approach would be to use CSG when it comes to modeling such object. I'm failing to understand how to implement this though. There are mentions of using Interval Arithmetics but I don't understand how exactly are they supposed to help me.
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?