Ruby is the red variety of the mineral corundum (Al2O3). In the structure of atoms which makes up a ruby, small amounts of chromium (normally about 1 per cent) can replace aluminium. In pure corundum, which is colourless, all the energy levels in the aluminium and oxygen are occupied by paired electrons. In chromium, however, six electrons are available for bonding but only three are required – this leaves partially filled energy levels. Electrons in these can absorb energy from visible light. The energy remaining corresponds to red light in the spectrum. Simultaneously ruby will absorb energy in the ultraviolet and re-emit it in the visible part of the spectrum as red light (ie fluorescence). The red colour is therefore ultimately caused by the presence of chromium.
Answered by Brian Jackson, principal research curator of Mineralogy at National Museums Scotland.