ABSTRACT X-ray radiation, in particular radiation between 0.1 and 10 keV, is evident from both point-like sources, such as compact objects and T-Tauri young stellar objects, and extended emission from hot, cooling gas, such as in supernova remnants. The X-ray radiation is absorbed by nearby gas, providing a source of both heating and ionization. While protoplanetary chemistry models now often include X-ray emission from the central young stellar object, simulations of star-forming regions have yet to include X-ray emission coupled to the chemo-dynamical evolution of the gas. We present an extension of the treeray reverse ray trace algorithm implemented in the flash magnetohydrodynamic code which enables the inclusion of X-ray radiation from 0.1 keV < Eγ < 100 keV, dubbed xraythespot. xraythespot allows for the use of an arbitrary number of bins, minimum and maximum energies, and both temperature-independent and temperature-dependent user-defined cross-sections, along with the ability to include both point and extended diffuse emission and is coupled to the thermochemical evolution. We demonstrate the method with several multibin benchmarks testing the radiation transfer solution and coupling to the thermochemistry. Finally, we show two example star formation science cases for this module: X-ray emission from protostellar accretion irradiating an accretion disc and simulations of molecular clouds with active chemistry, radiation pressure, and protostellar radiation feedback from infrared to X-ray radiation.