When a sodium atom transfers an electron to a chlorine atom, forming a sodium cation (Na+) and a chloride anion (Cl-), both ions have complete valence shells, and are energetically more stable. The reaction is extremely exothermic, producing a bright yellow light and a great deal of heat energy.