...they could have death rays of doom that vaporize ships.
They did, it was called a transporter. All you have to do is transport and enemy ship and then don't put it back together right, or at all. 8472 isn't much of a threat when the Voth can just render them all down into raw replicator feed as fast as they can say "Energize."
Also, just wanted to point out, "Could the Voth handle 40 ships at once?" Yeah, it totally could. The Voth city ship was at least 5,000 times more massive than a Sovereign class starship. Probably more like 25,000 times given how they're shaped. Even if the city ship was only armed to Galaxy like levels, more hotel than warship, I'd say a Voth city ship, even if you don't count their ship transporters or hacking, could handle two or three hundred Federation starship at once. Once you factor in their ability to just turn off ships at will and disassociate other's atoms as fast as their transporter can recharge in spite of shields... I don't think Starfleet could do much about even a single city ship, much less half a dozen or more of them. Not to mention their transwarp, phase cloak, and incredibly long range scanning abilities make it possible for them to avoid letting Starfleet ever gang up on them anyways.