First of all, what do we mean by a region with two boundaries? Here's an example. Let S1 be the sphere of radius 1 centered at the origin and let S2 be the ellipsoid x2 + y2 + 4z2 = 16, both oriented outward.
Clearly, S2 contains S1. Let's call the solid region in between them W. W has two boundaries: S2 is its outer boundary and S1 is the inner boundary. To calculate the total flux out of the region W we need the flux through both of these surfaces. But watch out! Since ``out of W'' points in the opposite direction of the orientation of S1, we need to subtract the flux through S1 from the flux through S2:
For a good example of an application of this using the divergence theorem, check out problem 9 on the fall 1996 final exam.