We give a formula relating the order of the Brauer group of a surface fibered over a curve over a finite field to the order of the Tate-Shafarevich group of the Jacobian of the generic fiber. The formula implies that the Brauer group of a smooth and proper surface over a finite field is a square if it is finite.