What is the rule for throwing a baseball bat?
Assuming you mean the batter throwing or flinging it by
accident, it means he's out. At least in every amateur league I've
ever seen.
If you mean throwing the bat in disgust or on purpose, it means
he's out of the game.
However, in MLB there is no rule prohibiting "throwing a bat."
There are rules that cover penalties if the thrown bat hits the
ball, interference, and disagreeing with an umpire's call, but
there is no rule that specifically prohibits throwing a bat in and
of itself.
A batter is not allowed to throw his bat after he hits the ball.
In younger stages of playing ball, the players will get a warning,
but in severe cases the hitter is subject to ejection.