Normal Vector to Rotation

This is more of a math question, but I think this is the right forum to ask it in

I want to create spotlights that point in the directino of the normal of the face, how do I set the rotation of the light to the normal of the face?

though i do not know the answer, i suspect a vital clue lies within the beast script.

an example :
http://jmsoler.free.fr/didacticiel/blender/tutor/cpl_b223new.htm#rampofspotscript