Chemicals which can absorb UV-visible light are those with pi electrons (aromatic compounds, molecules with conjugated bonds) and those capable of d-electron transitions (transition metals and their complexes). Molecules with pi electrons are able to absorb the energy from UV and visible light to excite electrons to higher molecular orbitals.
The lower the energy difference between the lowest unoccupied molecular orbital (LUMO) and the highest occupied molecular orbital (HOMO) the lower the energy (longer wavelength) of the incident radiation required to cause excitation.
The specific energy required to cause excitation will be dependent on the chemical structure of the molecule undergoing the process hence the absorbance pattern can be used to help identify a molecule of interest.
Other chemicals can also absorb UV-visible light by excitation of available d-electrons and transfer of electrons from ligands to co-ordinated metals in metal-ligand complexes.
The Beer-Lambert law states that there is a linear relationship between light absorbance and the concentration of the absorbing species which is dependent on the light path length and the medium used (e.g. water). This means that the absorbance of a sample can be used directly to measure the concentration of an absorbing species in solution.