Photosynthetic pigments are composed of a hydrocarbon tail bound to an active site that contains Mg2+.  The several different pigment types absorb light at different wavelengths.  Chlorophyll a (plants and algae) absorb light wavelengths between 425 and 660 nM (violet and red), while bacteriochlorophyll in purple sulfur bacteria absorb wavelengths between 350 and 880 nm (ultraviolet and infrared).  Pigments are embedded in layers of membranes called thylakoids (layers of the cell membrane in bacteria, foldings of the inner membrane of eukaryotic chloroplasts).  The fluid interior of the chloroplast is called the stroma and contains enzymes for the synthesis reactions of photosynthesis.  The light reactions responsible for ATP generation, called photosystems I and II, occur in the thylakoids.