As Aaron747 mentioned already, the tendency of jet engine fans to spin when not running is attributed to "windmilling." Windmilling is just that - the tendency of a propeller or jet fan or any other set of airfoils in that sort of arrangement to spin even when not being powered. It all has to do with the various components of airflow...
In normal operation, a propeller/fan is spun under power to achieve thrust. The spinning creates an apparent airflow directed parallel and opposite in direction to the rotation. Assuming the airplane is in forward flight, there's another flow component created by the freestream, which is approximately perpendicular to the rotation-induced flow. The resultant is obviously a flow directed partway between the two component flows:
Note that there is a "positive" AoA, which produces a forward lift (thrust).
Now, what if the engine stops? Well, due to drag (both parasitic and induced) and friction within the engine, the prop's/fan's rotational speed begins to decrease. Accordingly, the crosswise flow component decreases as well, moving the resultant flow so that AoA decreases. Eventually, the resultant flow is such that the AoA becomes "negative," producing backwards lift (drag). The (backwards) lift vector is oriented with a prop/fan rotation-wise component, so that it induces continued rotation:
Of course, a plane doesn't need to be flying to experience windmilling of its engines - wind will cause windmilling when on the ground, which is the spinning you (Flybyguy) were wondering about.
It's getting late here and I'm about to go to bed, so please forgive me if I left anything out...