Sunspots are intense collections of magnetic fields that pierce through the Sun’s photosphere, with their signatures extending upwards into the outermost extremities of the solar corona. Cutting-edge observations and simulations are providing insights into the underlying wave generation, configuration and damping mechanisms found in sunspot atmospheres. However, the in situ amplification of magnetohydrodynamic waves, rising from a few hundreds of metres per second in the photosphere to several kilometres per second in the chromosphere, has, until now, proved difficult to explain. Theory predicts that the enhanced umbral wave power found at chromospheric heights may come from the existence of an acoustic resonator, which is created due to the substantial temperature gradients experienced at photospheric and transition region heights11. Here, we provide strong observational evidence of a resonance cavity existing above a highly magnetic sunspot. Through a combination of spectropolarimetric inversions and comparisons with high-resolution numerical simulations, we provide a new seismological approach to mapping the geometry of the inherent temperature stratifications across the diameter of the underlying sunspot, with the upper boundaries of the chromosphere ranging between 1,300 ± 200 km and 2,300 ± 250 km. Our findings will allow the three-dimensional structure of solar active regions to be conclusively determined from relatively commonplace two-dimensional Fourier power spectra. The techniques presented are also readily suitable for investigating temperature-dependent resonance effects in other areas of astrophysics, including the examination of Earth–ionosphere wave cavities.