Our current understanding of the chemistry and mass-loss processes in solar-like stars at the end of their evolution depends critically on the description of convection, pulsations and shocks in the extended stellar atmosphere (1). Threedimensional hydrodynamical stellar atmosphere models provide observational predictions (2), but so far the resolution to constrain the complex temperature and velocity structures seen in the models has been lacking. Here we present submillimeter continuum and line observations that resolve the atmosphere of the asymptotic giant branch star W Hya. We show that hot gas with chromospheric characteristics exists around the star. Its filling factor is shown to be small. The existence of such gas requires shocks with a cooling time larger than commonly assumed. A shocked hot layer will be an important ingredient in the models of stellar convection, pulsation and chemistry that underlie our current understanding of the late stages of stellar evolution.Asymptotic giant branch (AGB) stars are among the most important sources of enrichment of the Galactic interstellar medium (ISM). Molecules and dust formed in the warm extended atmospheres and the cool and dense circumstellar envelopes (CSEs) around AGB stars are injected into the ISM by a stellar wind that has overcome stellar gravity (1). It is generally assumed that the stellar wind is driven by radiation pressure on dust that forms at a few stellar radii, where the temperature in the CSE has dropped so that dust condensation can occur (3). In order for the gas in the extended stellar atmosphere to reach the dust formation region, the most recent AGB mass-loss models typically invoke stellar pulsations and convective motions (2,(4)(5)(6).Both convective motions and pulsations induce outward moving shocks that critically affect the upper layers of the AGB atmosphere where the stellar mass loss is determined. The propagation of shocks also strongly affects the chemistry in the stellar atmosphere (7-9). In early AGB atmosphere models, the outward propagation of strong shocks is responsible for the creation of a chromosphere (6, 10), from which ultraviolet line and continuum emissions originate. Such emissions have been observed from AGB stars (11,12). However, the observations of molecules and dust close to the star are not consistent with the extended chromosphere produced by the models. Observations have so far not been able to resolve this ambiguity. High angular resolution images of the stellar disks of AGB stars have revealed asymmetries of which the source is not yet clear, but convective motions are believed to play a role (13)(14)(15)(16). Since at most wavelengths, the observations are probing distinct molecular opacity sources (16), or averages over the stellar disk (17), the dynamics and temperature structures in the atmosphere closest to the stellar photosphere have not yet been observed in detail.We present observations of the AGB star W Hya that reveal evidence for the presence of shocks and map the distribution of molecular g...