Betelgeuse, a nearby red supergiant, is a runaway star with a powerful stellar wind that drives a bow shock into its surroundings 1-4 . This picture has been challenged by the discovery of a dense and almost static shell 5 that is three times closer to the star than the bow shock and has been decelerated by some external force. The two physically distinct structures cannot both be formed by the hydrodynamic interaction of the wind with the interstellar medium. Here we report that a model in which Betelgeuse's wind is photoionized by radiation from external sources can explain the static shell without requiring a new understanding of the bow shock. Pressure from the photoionized wind generates a standing shock in the neutral part of the wind 6 and forms an almost static, photoionization-confined shell. Other red supergiants should have significantly more massive shells than Betelgeuse, because the photoionization-confined shell traps up to 35 per cent of all mass lost during the red supergiant phase, confining this gas close to the star until it explodes. After the supernova explosion, massive shells dramatically affect the supernova lightcurve, providing a natural explanation for the many supernovae that have signatures of circumstellar interaction.Red supergiants are massive stars near the end of their lives, and are direct progenitors of core-collapse supernovae 7, 8 . They evolve from O-and B-type stars (hot, luminous sources of ionizing photons), and so these stars are often found together, within or near star clusters 9 . As a result, the cool stellar winds of red supergiants are often photoionized by external radiation fields [10][11][12][13] . To calculate the radiation hydrodynamics of a photoionized red supergiant wind, we simplify the problem by assuming spherical symmetry. We use an approximate two-temperature equation of state for the gas, for which both the neutral and photoionized gases are isothermal with 1 temperatures T = T n and T i ≫ T n , respectively. The ionized and neutral isothermal sound speeds similarly satisfy a i ≫ a n . The photoionized part of the red supergiant wind is accelerated as a result of ionization heating 14 , whereas the neutral part is decelerated 6 if the wind speed through the ionization front, v n , satisfies v n ≤ 2a i .The resulting flow is depicted in Fig. 1. The outermost layer is the interface where the wind meets the interstellar medium. For static stars this is a spherical, detached shell, and for stars moving supersonically it is a bow shock. A photoionization-confined shell -a dense, shocked layer separating the neutral inner wind from the ionized outer wind -forms closer to the star. We identify this with the recently-discovered shell in Betelgeuse's circumstellar medium 5 .The properties of the photoionization-confined shell are calculated analytically and verified with simulations in Methods. Its outer boundary, R IF , is calculated following previous work 10 (Extended Data Fig. 1), and the standing shock radius, R shell , is obtained by requiring pressur...