Materials such as biomass (e.g., plant biomass, animal biomass, and municipal waste biomass) and hydrocarbon-containing materials are processed to produce useful products, such as fuels. For example, systems are described that can use feedstock materials, such as cellulosic and/or lignocellulosic materials and/or starchy materials, or oil sands, oil shale, tar sands, bitumen, and coal to produce altered materials such as fuels (e.g., ethanol and/or butanol). The processing includes exposing the materials to an ion beam.