To understand what they do we have to look at the Nano-scale. By shining different color light (different frequency) at the material we can excite it in different ways. These are different for each molecule but often involve extensions, contractions and vibrations of bonds. In some organic materials it will also involve rotations of part of the molecule.
We cant actually see these movements as it at such a small scale, the only way we can see is to wait for the molecule to relax (stop being excited) and it emits light again. The difference between the light absorbed and the light emitted tells you what the molecule was doing.