Context. The recent unexpected detection of terrestrial complex organic molecules in the cold (∼10 K) gas has cast doubts on the commonly accepted formation mechanisms of these species. Standard gas-phase mechanisms are inefficient and tend to underproduce these molecules, and many of the key reactions involved are unconstrained. Grain-surface mechanisms, which were presented as a viable alternative, suffer from the fact that they rely on grain surface diffusion of heavy radicals, which is not possible thermally at very low temperatures. Aims. One of the simplest terrestrial complex organic molecules, methanol is believed to form on cold grain surfaces following from successive H atom additions on CO. Unlike heavier species, H atoms are very mobile on grain surfaces even at 10 K. Intermediate species involved in grain surface methanol formation by CO hydrogenation are the radicals HCO and CH 3 O, as well as the stable species formaldehyde H 2 CO. These radicals are thought to be precursors of complex organic molecules on grain surfaces. Methods. We present new observations of the HCO and CH 3 O radicals in a sample of prestellar cores and carry out an analysis of the abundances of the species HCO, H 2 CO, CH 3 O, and CH 3 OH, which represent the various stages of grain-surface hydrogenation of CO to CH 3 OH. Results. The abundance ratios between the various intermediate species in the hydrogenation reaction of CO on grains are similar in all sources of our sample, HCO:H 2 CO:CH 3 O:CH 3 OH ∼ 10:100:1:100. We argue that these ratios may not be representative of the primordial abundances on the grains but, rather, suggest that the radicals HCO and CH 3 O are gas-phase products of the precursors H 2 CO and CH 3 OH, respectively. Various gas-phase pathways are considered, including neutral-neutral and ion-molecule reactions, and simple estimates of HCO and CH 3 O abundances are compared to the observations. Critical reaction rate constants, branching ratios, and intermediate species are finally identified.