As radiation enters a solid or liquid, the light waves are absorbed and reflected by the atoms. the resulting reflection from an atom can be in any direction and is random. you can understand opacity in terms of the scattering of radiation. The more opaque, the more scattering.
(The truth is far more complicated than this, check out Richard Feynmans lectures on "Quantum Electro Dynamics" to learn the reality of it. )