When the light propagation in air or some other medium, the energy will be attenuating, due to the absorbs. So, you can judging the distance of the path length by measuring the energy loss.
Usually, the light beam is not the perfect plane wave, the beam width also
changes with the distance.