Comparator - get the difference between inputs?
A difference amplifier will do what you want, but it has a potentially serious problem. The input impedances are not well defined, or matched. Referencing Jay's circuit, the input impedance of the noninverting side is \$R_1+R_f\$. That is as close to a defined input impedance as we get with this topology. Since there is negative feedback, the inverting pin will track the noninverting pin. What would normally be a virtual ground is now varying based on \$V_+ \$, and with it the input impedance of the inverting side. 

If this issue is a problem for your application, a better option would be an instrumentation amplifier. 



\$V_{out}=(1+\dfrac{2R_1}{R_{gain}})(\dfrac{R_3}{R_2})(V_2-V_1)\$

The inputs are buffered and have matched input impedances, equal to the op amp input impedance. You can either build one yourself, or buy an IC. An IC solution will ultimately have better performance, especially in common mode rejection.