Current theory is that electrons in an atom can have only certain energy states. Materials absorb these frequencies whose energies are equal to difference between energy states available for a particular atom or a molecule.
The problem with quantum mechanics is that there is no way to verify its claims.