If we take the example of sun and water (sea or ocean).
Light from the sun is attenuated by the atmosphere before reaching the surface of the water; underwater, the attenuation is considerable, infrared is absorbed in the first meter and light reaches 100 meters. Beyond 1000 meters is the dark night.
As in all environments, two phenomena contribute to the attenuation of light: Absoption and diffusion.
The absoption of light in the sea is the absorption of photon energy by energy level transition of the atoms and molecules that make up seawater.
Light scattering is a physical phenomenon that occurs when optical inhomogeneities of the medium cause random changes in the direction of the light rays.
The attenuation of light under water is mainly due to absorption, the diffusion being of less importance.