I observed the absorbance on Phenolphthalein in acidic and basic medium, and I know that the absorbances differ due to the number of conjugated double bonds, but I am not sure exactly why this happens. I believe it has something to do with the delocalised electrons, which causes lower energy differences, but I am unable to establish a solid link between the concepts. Why does this happen?
When 2 p orbitals mix, a pi and a pi* orbital is formed, and the electrons occupy the lower energy pi orbital. The UV-absorbance is the energy difference between these two orbitals such that on electron may be 'promoted' to the p* orbital.
When 3 p orbitals mix, three pi-type orbitals are formed. One is obviously bonding and one is obviously antibonding. There is a third one 'in the middle', frequently called non-bonding. Because of this third orbital, there is a smaller difference between any two states, and as such absorbing a photon to promote an electron requires less energy, redshifting the absorbance.
Add a fourth p orbital and the energy differences get smaller, but with two bonding orbitals and two anti-bonding orbitals. Add a 5th p orbital and now you have two bonding orbitals and two anti-bonding orbitals and a non-bonding orbital, with even smaller differences. Repeat ad nauseum.
Smaller energy differences means longer wavelengths.
Check out this picture for a graphical summary: