He is awarded first base due to interference or obstruction, usually by the catcher.
The inning ends while he is still at bat (due to the third out being made by a runner caught stealing, for example). In this case, the batter will come to bat again in the next inning, though he now has no balls or strikes on him.
He is replaced by another hitter before his at bat is completed (unless he is replaced with two strikes and his replacement strikes out).
Section 10.02.a.1 of the official rules of Major League Baseball defines an at bat as:
"Number of times batted, except that no time at bat shall be charged when a player: (1) hits a sacrifice bunt or sacrifice fly; (2) is awarded first base on four called balls; (3) is hit by a pitched ball; or (4) is awarded first base because of interference or obstruction..."[2]
↑In 1887, Major League Baseball counted bases on balls as hits. The result was high batting averages, including some near .500, and the experiment was gotten rid of the following season.