That "Socialist country" is almost certainly Germany, as this is exactly as these things are handled here.
SHOULD an insurance company run out of money their bills will be paid with the money that all health insurance providers collectively had to put aside fore exactly that case. A similar system is used to ensure that if a bank runs out of money the people will still be able to access all or a significant amount of the money they entrusted that bank with. I'm pretty sure that a similar system is in effect for banks in the US as well. I don't know if the health insurance providers are backed-up similarly in the US.
And yes, the insurance providers do sometimes increase their rates. But not because they run out of money due to having to pay for too many sick days. They know that this is the law and they calculate accordingly.
These laws ensure that if you get sick, you can concentrate on getting better rather than having to worry about how to pay your bills.
I know this is a strange concept for some people, but laws sometimes can be written to benefit the people, rather than companies.