At any instant, one side of the ball will be moving in the same direction as the air and the other side will be moving against the air. The side of the ball moving in the same direction as the air will have a region of air at higher velocity, and therefore less pressure (Bernoulli’s principle) than the opposite side, which is moving into the air and creating higher pressure. This results in a net force from the high-pressure side to the low pressure side that is known as the Magnus effect (after the German physicist Heinrich Gustav Magnus, who ran experiments on spinning cylinders to explain the unpredictable behavior of spinning artillery shells in 1852).

Joshua Sadlock has a nice overview of the mathematical equations involved in throwing and hitting a baseball. If only it was a simple as math.