A California refinery exploded Thursday, turning the night sky into an orange fireball and causing one community to order residents to stay indoors, according to officials.