To atone for my sins, I also wrote a (free, online) 3D rendering textbook, half of it dedicated to raytracing: http://www.gabrielgambetta.com/computer-graphics-from-scratc...