The wavelength necessary to effect the pi -> pi* transition in a conjugated molecule depends on the energy gap between HOMO and LUMO, which in turn depends on the nature of the conjugated system. Thus, by measuring the UV spectrum of an unknown, we can derive structural information about the nature of any conjugated pi electron system present in a molecule.
-- John McMurry, Organic Chemistry 8th ed. (2012), Ch. 14, Conjugated Compounds and Ultraviolet Spectroscopy