We report on a detailed study of the X-ray spectrum of the nearby eclipsing spectroscopic binary YY Gem . Observations were obtained simultaneously with both large X-ray observatories , XMM-Newton and Chandra . We compare the high-resolution spectra acquired with the Reflection Grating Spectrometer onboard XMM-Newton and with the Low Energy Transmission Grating Spectrometer onboard Chandra , and evidence in direct comparison the good performance of both instruments in terms of wavelength and flux calibration . The strongest lines in the X-ray spectrum of YY Gem are from oxygen . Oxygen line ratios indicate the presence of a low-temperature component ( 1 - 4 MK ) with density n _ { e } \leq 2 10 ^ { 10 } { cm ^ { -3 } } . The X-ray lightcurve reveals two flares and a dip corresponding to the secondary eclipse . An increase of the density during phases of high activity is suggested from time-resolved spectroscopy . Time-resolved global fitting of the European Photon Imaging Camera CCD spectrum traces the evolution of temperature and emission measure during the flares . These medium-resolution spectra show that temperatures > 10 ^ { 7 } K are relevant in the corona of YY Gem although not as dominant as the lower temperatures represented by the strongest lines in the high-resolution spectrum . Magnetic loops with length on the order of 10 ^ { 9 } cm , i.e. , about 5 % of the radius of each star , are inferred from a comparison with a one-dimensional hydrodynamic model . This suggests that the flares did not erupt in the ( presumably more extended ) inter-binary magnetosphere but are related to one of the components of the binary .