To integrate the Phong lighting model into a raytracer, you essentially use the raytracer to handle the geometry and visibility (finding what the light hits), while the Phong model handles the color and intensity calculation at that specific hit point.
In a standard raytracer, for every pixel, you cast a primary ray from the camera into the scene. When that ray intersects an object, you calculate the lighting for that point using the three components of the Phong model: Ambient, Diffuse, and Specular.
When your ray