Briefly, the mechanism is due to so-called colour centres: electronic bound states of the positively charged defects/impurities that give rise to absorption peaks in the optical spectrum of otherwise optically transparent crystals. The subject matter is discussed in Chapter 30 of the book Solid State Physics, by Ashcroft and Mermin.
Besides the cause in Behnam Farid answer (color centers) it could be:
1. Transition between the conduction band and donor impurity (impurity that could give an electron to conduction band) or between valence band and acceptor impurity (impurity that could catch an electron off the valence band).
2. Transition between donor and acceptor impurity.
3. Internal transition in impurity if impurity is transition-metal or rare-earth impurity.
Causes 1 and 2 could be if your crystal is a wide-gap semiconductor. Color center is a particular case of donor-type impurity) The cause 3 is universal and could be in both semiconductor and dielectric crystal.