"i.e." (latin abbreviation for "id est") means "That is." "I.e." is used in place of "in other words," or "it/that is." It specifies or makes more clear.
On the other hand, "e.g." (Latin for "exampli gratia") means "for the sake of example." "E.g." is used in expressions similar to "including," when you are not intending to list everything that is being discussed.
I suppose "ex" would be a much less formal way of saying "e.g."
Here's an illustration from About.com:
I.E. (Id Est)
I'm going to the place where I work best, i.e., the coffee shop. [There is only one place that I am claiming is best for my work. By using "i.e.", I am telling you I am about to specify it.]
E.G. (Exempli Gratia)
At the places where I work best, e.g., Starbucks, I have none of the distractions I have at home. [There are lots of coffee shops I like, but Starbucks is the only international one, so it's the only "example" that would work.]