Ball Bouncing System

Egomoose has an amazing tutorial on calculating this. Warning: it has [spoiler]math[/spoiler]

Good luck!