Pressure oscillations in a sound wave are accompanied by temperature oscillations. In the presence of a solid boundary, the heat transfer from the oscillating gas to the solid boundary causes dissipation of the acoustic energy. This results in the attenuation of the sound wave. This thermal-relaxation dissipation process has a negative effect on the performance of thermoacoustic heat pumps and engines. A simple analytical model describing the interaction between an acoustic wave and a solid boundary is presented. The effect of the solid material and gas type on thermal-relaxation dissipation is analysed. The main result of this model is that the choice of a solid material with the smallest possible heat capacity per unit area in combination with a gas with the largest possible heat capacity per unit area minimises the thermal-relaxation dissipation. From the different combinations solid-gas used in the calculations, the combination cork-helium leads to the lowest thermal attenuation of the sound wave. In this case, the heat transfer from the gas to the wall less damps the temperature oscillations. However, because of the porosity of cork that may cause some problems, it is suggested that the combination polyester-helium can be used in practice to minimise the thermal-relaxation losses.