Attenuating light source via glLight methods?

Is it possible to easily implement attenuating light (you have moving objects or light source, and as they get further from each other, the object becomes darker)?

The way I understand it is, if an object has a face that is facing the light source it will be fully lit no matter distance. Can I change this?

*Disclaimer: I remember very little from the OpenGL deprecated functions

You have to set the attenuation parameter for that light.
So something similar to:

glLightf(GL_LIGHT0, GL_CONSTANT_ATTENUATION, 0.5f);

The default value is 1.0 for attenuation, which means no attenuation. And the min value is 0.

Down near the bottom of this page is a more detailed explanation of the attenuation parameters and how the attenuation is computed.
http://www.khronos.org/opengles/sdk/1.1/docs/man/glLight.xml