Create a LightMap with raytracing

hi,
I want to create a light map render using ray tracing for learning purpose.
I already builded the raytracer part, but i dont know how to generate the lightmap from that.
Today, i just throw the rays from my camera, calculate the intersection, shading, throw extra rays …
But how do i use this to generate the lightmap ?
Do i need throw rays from each texel of my model’s texture (get the model position corresponding to the texel …) ? (how many rays should i throw !!!) Is this the right way ?

Thanks !!

There are dozens of ways to create LightMaps. A similar question has been posted in GameDev Forum: http://www.gamedev.net/topic/634349-create-a-lightmap-with-raytracing/

Perhaps you can take same ideas from other (radiosity-based) projects like:

The main difficulty is related to uv-mapping and its correspondance with 3D coordinates as pointed in:

Good luck!