I
2 + Cs
(s) CsI
(s)If you look at the elements electronegativities
http://en.wikipedia.org/wiki/Electronegativity, iodine is much more electronegative than cesium. This means that iodine is eager to attract one electron in order to become the I
- which has a more stable electronic configuration. On the other side of the periodic table, cesium is willing to give away one electron in order to become Cs
+, which is more stable.
So, when iodine comes in contact with cesium, both agree to exchange one electron to form the salt CsI.
Remark, CsI is not a molecule as such, but it is a salt constituted of cations Cs
+ and anions I
-. And it is not diatomic, instead it contains many anions and cations arranged in a 3-dimensional structure
http://en.wikipedia.org/wiki/CsI.