The production cross section for a W boson and two b jets is measured using proton-proton collisions at sqrt(s) = 7 TeV in a data sample collected with the CMS experiment at the LHC corresponding to an integrated luminosity of 5.0 inverse femtobarns. The W + b b-bar events are selected in the W to mu nu decay mode by requiring a muon with transverse momentum pt > 25 GeV and pseudorapidity abs(eta) < 2.1, and exactly two b-tagged jets with pt > 25 GeV and abs(eta) < 2.4. The measured W + b b-bar production cross section in the fiducial region, calculated at the level of final-state particles, is sigma(pp to W + b b-bar) x B(W to mu nu) = 0.53 +/- 0.05 (stat.) +/- 0.09 (syst.) +/- 0.06 (theo.) +/- 0.01 (lum.) pb, in agreement with the standard model prediction. In addition, kinematic distributions of the W + b b-bar system are in agreement with the predictions of a simulation using MADGRAPH and PYTHIA.