Planets are in equilibrium with their surroundings: they are neither getting hotter nor colder. All planets absorb incident radiation from the Sun (this heats them up); to maintain equilibrium, they must radiate away the same amount of energy. The temperature of a planet can be approximated by assuming that it is a black body.
You determine the temperature by equating the planetary luminosity (proportional to its temperature raised to the fourth power, T4) to the solar irradiance (L/D2, where L is the solar luminosity and D is the distance to the Sun). The distance at which a planet is at temperature T is proportional to 1/T2. Merely plug in the values of the upper and lower temperature to get the radii of the inner and outer radii of the habitable zone.
To do this correctly, you need to take into account a number of effects:
The likelihood of finding a planet in the habitable zone depends on the area in the habitable zone. This is proportional to Do2 - Di2, where Do and Di are the outer and inner boundaries of the zone, respectively. Since D2 is proportional to the stellar luminosity, the area of the habitable zone, and the likelihood of finding planets in it, is largest for the massive O, B, and A stars on the upper main sequence. In the figure at left, the habitable zone (yellow) is plotted as a function of spectral type for main sequence stars. The planets of our solar system are indicated. Planets inside the "tidal lock radius" are tidally locked to the star, i.e., they rotate once per year, or a fractional number of times per year. Mercury rotates three times every two Mercurian years. (The Moon is tidally-locked to the Earth, and rotates once per month).
(These illustration are downloaded from http://www.astro.psu.edu/users/williams)