In Quantum Optics by Mark Fox, it says that a lossy medium can be modeled by a beam splitter that splits part of the input and sends it to the "loss port", while the unabsorbed energy propagates to the output. This model accounts correctly for the loss, the increased noise at the output etc. Is there a generalized version of this picture, where the medium's absorbtivity changes smoothly over its volume (no boundaries or discontinuities, just a gradual change in loss density). Let's assume the refractive index doesn't change over the volume. So I'm looking for an explanation of how to treat each elemental volume as a beam splitter, integrating over the total volume to get the correct transmission and absorption profile. It should work properly even when there may be standing waves or other interference patterns over the medium. The model should respect unitarity at each element.