using a relay to swich between main and solar power
There is more to it that you may not realize. By using manual switching, you inherently prevent even the remotest possibility of back-feeding the utility grid with your solar power. It is not physically capable of being connected to both systems simultaneously. As soon as you "automate" this, you introduce the possibility that something could fail in an unsafe state. The result could then be that your solar system is feeding the grid and a utility line worker is killed by it because he is working on the wires when your "transfer switch" screws up and connects. For that very reason, as soon as you go with anything other than a manual changeover switch, it must have certification that your power utility accepts regarding its safety. 

You will need to start there before you buy anything.

And to answer your question about using solid state switching, absolutely not. Solid state switches "leak" when they are supposedly off. The leakage is minimal and for general purposes is often ignored, but for something like this it is potentially lethal.