Mixing AC sources as you are imagining is an absolute nightmare; you need to control the amplitude and phase angle exactly. It is sort of possible using a multi-primary ferro-resonant transformer, but with extreme losses (and cost), so I imagine that isn't something you would be interested in.
Your best solution would simply be to operate your load off of a single DC battery Link, driving an inverter. Size a main's supply to be just lower than your solar supply voltage, and parallel them to the battery charging circuit with series diodes in each supply line. When the solar panel cannot deliver the required voltage, the mains supply will silently switch in.
You can control an active circuit with a PIC or Arduino and some MOSFETS if you want to actively control how much power is delivered by each source by PWM'ing the sources to the DC Link.