How does a spectrophotometer work?

This short animation demonstrates the inner workings of a spectrophotometer.