The ex-dividend date is the date on which one must own a stock to qualify to receive payment of the dividend. It is usually two market days prior to the record date.
For example, a record date on a Thursday implies an ex-dividend date on the preceding Tuesday. Consider Person A, who owns the stock as of Monday. On Tuesday, he sells it to Person B, who is said to receive the stock ex-dividend. Persons B's name will not appear in the company's records until three days after his purchase (that is, Friday). Thus when the company pays the owners of its stocks listed in its records on Thursday, it is Person A who will receive the dividend.