Optical properties of linear-chain mercury compounds