Scene of destruction: Firefighters quelled the flames by spraying foam over the apartment buildings