This much we know: When a batter attempts to hit a pitch, whether a full swing, check swing or bunt attempt, it is a strike. But what happens when that batter attempts to hit or bunt the pitch and is then struck by the pitch? Is the batter awarded first base? Can runners advance? Can the catcher pick up the ball and throw to a base to retire a runner?
The basic rule is that swinging at a pitch or attempting to bunt a pitch trumps being hit by the pitch. So, if a batter is judged to have offered at the pitch and then is struck by the pitch, it should be called a strike. The ball is ruled dead and all runners must return to their base at the time of the pitch. The same goes for a pitched ball that bounces in the dirt, batter offers at the pitch and the batter is then touched by the pitch. Dead ball, strike on the batter.
Another related play might involve a batter being struck by a pitch that is in the strike zone and called a strike by the umpire. In this case the ball is dead and a strike is called on the batter.
Official Rule 5.05 covers this scenario.
The batter becomes a runner and is entitled to first base without liability to be put out (provided he advances to and touches first base) when—
(b) He is touched by a pitched ball which he is not attempting to hit unless (1) The ball is in the strike zone when it touches the batter, or (2) The batter makes no attempt to avoid being touched by the ball; If the ball is in the strike zone when it touches the batter, it shall be called a strike, whether or not the batter tries to avoid the ball. If the ball is outside the strike zone when it touches the batter, it shall be called a ball if he makes no attempt to avoid being touched.APPROVED RULING: When the batter is touched by a pitched ball which does not entitle him to first base, the ball is dead and no runner may advance.
Ted Barrett explains the rule in this video:
Cubs’ Manager Joe Maddon is ejected while arguing a related play.