Raycasting in Unity is applied against colliders only, not gameobjects. In fact, gameobjects are nothing other than a storage of transform info. If you want raycasting against meshes (MeshRenderer on a gameobject) you can use a meshcollider.
Raycasting, especially against meshes are very expensive so, basic colliders are designed for performance. Meshcolliders are expensive too but the cost can be reduced by using Convex flag = true. It generates a simplified mesh from the original mesh but you should make sure if it's close enough to your original mesh.
Without a mesh collider, you can't use the built-in raycast functions. You can implement your own function working against the real meshes (The mesh in MeshRenderer component) but you don't gain any benefit by doing this. Because raycasting is implemented for you in unity already.
Just add a meshcollider to every object you want to raycast against. By the way, you can use the layer system to be able to filter some objects out when you are raycasting.