A thermocouple works on the principle that the electrical resistance at the point where two wires of different composition join, is very sensitive to the temperature. So…a thermocouple consists of two wires joined to an electrical source. Current passes through the wires and they only touch eachother out at the tip of the thermocouple probe. The temperature of that tip controls the resistance of the current passing through the place where they join, and this resistance can be measured and converted to temperature information. These little wires are usually sheathed in a ceramic insulation with an outer sheath of stainless steel. The melting points of stainless steel, ceramic, and the two wires are all higher than the temperature of lava, so none of them melt.