|MadSci Network: Astronomy|
You're right: gravity is a spherically symmetric force,
and by itself can't produce any torques. But the symmetry of
the system is broken by the rotational and orbital motions of the
planet, which allows for a transfer of angular momentum to occur
between the planet and the Sun.
In more concrete terms, the culprit is tidal forces. The strength of the gravitational force varies with distance, so that a person on the "sunny side" (day side) of the Earth feels a stronger force from the Sun than does a person on the "dark side" (night side) of the Earth. For a large, "rigid" body like a planet, this means that there is an apparent "tidal force" stretching the planet out in the direction towards (and away from) the Sun. So the planet is no longer spherical, but bulges a bit.
This bulge is produced in the Earth's watery surface, producing ocean "high tides" (actually, the Moon has a stronger effect on us than the Sun does). To a lesser extent, the whole rocky body of the Earth is also distorted.
Anyway, as the planet rotates, the bulge swings around and does not have time to adjust back to pointing at the Sun. So the elongated planet does not point directly at the Sun, giving the Sun's gravity a "handle" to pull back on. This tug gradually slows down the rotation of the planet, until the bulge is always pointed directly at the Sun. At this point, the rotational period of the planet is the same as its orbital period (that is, its "day" is as long as its "year"!) This process is called "tidal locking" or "synchronization".
This process works best for bodies which are smaller and closer to the Sun -- Venus and Mercury, in particular. Venus is not exactly tidally locked (it actually rotates very slowly backwards, though I don't know why). And Mercury is actually in a 2:3 tidal lock with the Sun (it rotates 3 times for every 2 orbits), which is also due to the same effects (a little more complicated situation).
Tidal locking is especially prevalent among the planetary satellites. Our own Moon is tidally locked -- which is why we always see one side of it. And I don't know of any other major moons in the Solar System that aren't tidally locked.
Try the links in the MadSci Library for more information on Astronomy.