Thanks to the excellent tracking and muon identification performance, combined with a flexible trigger system, the CMS experiment at the Large Hadron Collider is conducting a rich and competitive program of measurements in the field of heavy flavor physics. We review the status of b-quark production cross section measurements in inclusive and exclusive final states, the measurement of B hadron angular correlations, the search for rare B-s(0) and B-0 decays to dimuons, and the observation of the X(3872) resonance.