What's the automatic equivalent of a variable resistor?
You can use a transistor to do this. Although less common that the other types, a JFET works much like a voltage controlled variable resistance. You'd have to apply an analog voltage to the gate to get a specific resistance. You'd have to be careful about the range of this voltage. The Drain and Source would act as the effective two terminal resistor. Even a mosfet has a linear resistive region so this is not your only option. There are many other options as well which I'm sure will be mentioned.