It's actually the hard, colorful calcareous skeleton secreted by certain marine polyps
Some internal skeletons contain calcareous or protein spicules, which 
stiffen and ... During the day, the coral polyp curls up inside its limestone shelter.