Raycast (in sense of finding an object in the game world) nowdays is done mostly by the physics engine. It is specialized anyways in locating interactions between two objects by various techniques and algorithms and so also capable of handling the ray intersection tests more proper than simly walking through a list of objects.
I guess it depends on the implementation side but objects may be for example located by a usual tree structure like quad-, R- or octrees and so a ray is first checking against the bounding box of a cell and on hit, fine graining the detection to deeper levels of that cell to find the object it targets to. If either of that fails, move on to the next cell and repeat.
But for a deeper know, you can visit GitHub and look either for