A heat rash, otherwise known as prickly heat or miliaria, occurs when sweat gets trapped in the skin, causing inflammation.