This phrase is used to describe an action at the end of an event that results in the individual bettor going instantly from winning the bet to losing the bet. It is usually used in reference to big losses, and is also used in card games when the final card drawn causes the individual to lose a hand (of cards).
A bad beat is known as such because the player is getting beat, and the sudden change of fortune is a horrible feeling no one wants to experience. An example of a bad beat is when someone who bet on the Philadelphia Eagles to cover the spread against the Dallas Cowboys in 2007. The Eagles were favored to win by a touchdown (6 points), and were winning 10-6 in the 4th quarter. The Eagles had the ball and Brian Westbrook rushed the ball all the way to the 1-yard line and kneeled down, avoiding scoring a touchdown. The Eagles proceeded to run out the clock and win the game ahead by 4. Individuals who bet on the Eagles to cover the spread experienced feelings of joy immediately followed by the gut-wrenching feeling of losing.