The chemistry of CH _ { 3 } OH and H _ { 2 } CO in thirteen regions of massive star formation is studied through single-dish and interferometer line observations at submillimeter wavelengths . Single-dish spectra at 241 and 338 GHz indicate that T _ { rot } = 30 - 200 K for CH _ { 3 } OH , but only 60 - 90 K for H _ { 2 } CO . The tight correlation between T _ { rot } ( CH _ { 3 } OH ) and T _ { ex } ( C _ { 2 } H _ { 2 } ) from infrared absorption suggests a common origin of these species , presumably outgassing of icy grain mantles . The CH _ { 3 } OH line widths are 3 - 5 km s ^ { -1 } , consistent with those found earlier for C ^ { 17 } O and C ^ { 34 } S , except in GL 7009S and IRAS 20126 , whose line shapes reveal CH _ { 3 } OH in the outflows . This difference suggests that for low-luminosity objects , desorption of CH _ { 3 } OH-rich ice mantles is dominated by shocks , while radiation is more important around massive stars . The wealth of CH _ { 3 } OH and H _ { 2 } CO lines covering a large range of excitation conditions allows us to calculate radial abundance profiles , using the physical structures of the sources derived earlier from submillimeter continuum and CS line data . The data indicate three types of abundance profiles : flat profiles at CH _ { 3 } OH/H _ { 2 } \sim 10 ^ { -9 } for the coldest sources , profiles with a jump in its abundance from \sim 10 ^ { -9 } to \sim 10 ^ { -7 } for the warmer sources , and flat profiles at CH _ { 3 } OH/H _ { 2 } \sim few 10 ^ { -8 } for the hot cores . The models are consistent with the \approx 3 ^ { \prime \prime } size of the CH _ { 3 } OH 107 GHz emission measured interferometrically . The location of the jump at T \approx 100 K suggests that it is due to evaporation of grain mantles , followed by destruction in gas-phase reactions in the hot core stage . In contrast , the H _ { 2 } CO data can be well fit with a constant abundance of a few \times 10 ^ { -9 } throughout the envelope , providing limits on its grain surface formation . These results indicate that T _ { rot } ( CH _ { 3 } OH ) can be used as evolutionary indicator during the embedded phase of massive star formation , independent of source optical depth or orientation . Model calculations of gas-grain chemistry show that CO is primarily reduced ( into CH _ { 3 } OH ) at densities n _ { H } { { } _ { < } \atop { { } ^ { \sim } } } 10 ^ { 4 } cm ^ { -3 } , and primarily oxidized ( into CO _ { 2 } ) at higher densities . A temperature of \approx 15 K is required to keep sufficient CO and H on the grain surface , but reactions may continue at higher temperatures if H and O atoms can be trapped inside the ice layer . Assuming grain surface chemistry running at the accretion rate of CO , the observed abundances of solid CO , CO _ { 2 } and CH _ { 3 } OH constrain the density in the pre-protostellar phase to be n _ { H } { { } _ { > } \atop { { } ^ { \sim } } } a few 10 ^ { 4 } cm ^ { -3 } , and the time spent in this phase to be { { } _ { < } \atop { { } ^ { \sim } } } 10 ^ { 5 } yr. Ultraviolet photolysis and radiolysis by cosmic rays appear less efficient ice processing mechanisms in embedded regions ; radiolysis also overproduces HCOOH and CH _ { 4 } .