In molten NaCl, the ions are free to move and as an electric current as applied to the liquid Na metal & Cl2 gas form around inert electrodes, such as carbon electrodes. The half-reactions are as shown below:
2 Na+(l) + 2 e- → 2 Na(l) (at the cathode)
2 Cl-(l) → Cl2(g) + 2 e- (at the anode)
with the net reaction being:2 Na+(l) + 2 Cl-(l) → 2 Na(l) + Cl2(g)