The infrared (IR) spectra of ultraviolet (UV) and thermally processed, methanol-containing interstellar/ cometary ice analogs at temperatures from 12 to 300 K are presented. Infrared spectroscopy, IH and _3C nuclear magnetic resonance (NMR) spectroscopy, and gas chromatography-mass spectrometry indicate that CO (carbon monoxide), CO2 (carbon dioxide), CH4 (methane), HCO (the formyl radical), H2CO (formaldehyde), CH3CH2OH (ethanol), HC(=O)NH2 (formamide), CH3C(_O)NH 2 (acetamide), and R--C_-N (nitriles) are formed. In addition, the organic materials remaining after photolyzed ice analogs have been warmed to room temperature contain (in rough order of decreasing abundance),hexamethylenetetramine (HMT, C6HI2N4), (2) ethers, alcohols, and compounds related to polyoxymethylene {POM, (--CH20--),}, and (3) ketones {R--C(=O)--R'} and amides {H2NC(=O)--R}. Most of the carbon in these residues is thought to come from the methanol in the original ice. Deuterium and 13C isotopic labeling demonstrates that methanol is definitely the source of carbon in HMT. High concentrations of HMT in interstellar and cometary ices could have important astrophysical consequences.The ultraviolet photolysis of HMT frozen in H20 ice readily produces the "XCN" band observed in the spectra of protostellar objects and laboratory ices, as well as other nitriles. Thus, HMT may be a precursor of XCN and a source of CN in comets and the interstellar medium. Also, HMT is known to hydrolyze under acidic conditions to yield ammonia, formaldehyde, and amino acids. Thus, HMT may be a significant source of prebiogenic compounds on asteroidal parent bodies. A potential mechanism for the radiative formation of HMT in cosmic ices is outlined.