You should use thermistors (and not varistors as someone suggested. Those are for overvoltage protection). There are 2 kinds NTC (negative temperature coefficient) which means that as the temperature goes up the resistance goes down, and PTC (positive temperature coefficient) where the resistance goes up with temperature. They are cheap, they come in every concievable package you might imagine. They are not that linear, so it this is important to you, there are ways to linearize them or just measure the table and use it. This the only solution for passive components. For active components, except using the diode approach, which is very good you can also use a lot of ready made temp sensors like LM50C etc.