The property of protein to absorb UV rays of light is due to:
Aromatic amino acids:-
Amino Acid Absorb UV Light: 
Amino Acids which absorb 250-290 nm (Maximum at 280 nm) UV light are tryptophan, phenylalanine, tyrosine. Maximum absorption of UV light by tryptophan. 
Remember: 

Aromatic amino acids absorb UV light. 
Amino acids are colorless because, they do not absorb visible light.
Peptide bond
Imino group
Disulfide bond
Aromatic amino acid