We present a measurement of the partial branching fractions and mass spectra of the exclusive radiative penguin processes B -> K pi pi gamma in the range m_Kpipi pi+ pi-. Using 232 million e+ e- -> B Bbar events recorded by the BaBar experiment at the PEP-II asymmetric-energy storage ring, we measure the branching fractions BR(B+ -> K+ pi- pi+ gamma) = (2.95 +- 0.13 (stat.) +- 0.20 (syst.)) x 10^-5, BR(B0 -> K+ pi- pi0 gamma) = (4.07 +- 0.22 (stat.) +- 0.31 (syst.)) x 10^-5, BR(B0 -> K0 pi+ pi- gamma) = (1.85 +- 0.21 (stat.) +- 0.12 (syst.)) x 10^-5, and BR(B+ -> K0 pi+ pi0 gamma) = (4.56 +- 0.42 (stat.) +- 0.31 (syst.)) x 10^-5.