A third-party beneficiary is a person who is not one of the two primary parties in a contract, but who stands to benefit from the contract anyway.
In the context of the law, third-party beneficiaries have the right to sue in the event of a breach of contract by one of the first two parties.
The reason why third-party beneficiaries have a right to sue is because they stand to gain from the contract, and they stand to lose if the contract is breached. Furthermore, contracts involving third-party beneficiaries are often created primarily for the benefit of the third-party beneficiary.
For example, a woman may create a contract with a car dealer in which she agrees to pay $10,000 for a car to give to her son. In this case, the son would be the third-party beneficiary, and he would have the right to sue the car dealer if the car dealer failed to live up to the contract.