I'm not a graphics programmer, but in listening to people who do this often, raytracing is like pimpin'. It ain't easy. Also, based on what they say, if you know the maths, it should be most of the battle.
I'm shocked though that google hasn't led to you a solution though.
This is the first link I found. Seems to have everything you want.