It's actually the hard, colorful calcareous skeleton secreted by certain marine polyps
[DOC] [TLE] Coral Reef Bleaching - Marine Biology Learning Center [PAR] When the coral polyp dies, this skeleton remains incorporated in the reef 
framework.