This happens occasionally. The most recent example that I can think of is when Kawaragi Shiho, the seiyuu of Nishizono Mio from Little Busters!, got pregnant. In fact, this is very recent, as she just gave birth last Friday (December 7th). Of course Mio isn't the main character, but she's not a minor character either.
In this case, they just replaced her (with Tatsumi Yuiko). That's about the only real option they have most of the time. Unless the problem is only for a very short duration, the entire show is not going to be delayed for one seiyuu. If it happens well in advance and the character is pretty important, they can probably work around it. Gotou Yuuko (seiyuu for Hiro from Hidamari Sketch), who was on hiatus for a while this year for health reasons but is back now in Hidamari Sketch x Honeycomb, is a good example of this. However, this is a pretty atypical situation, and the other shows she was in mostly got replacements.
In the end, unless the character is crucially important, it's very likely that they'll get a replacement, since it's pretty much the only realistic option. If something like this happens for a popular character in the off-season, it can also affect the possibility of sequels (e.g. most shows with Aya Hirano leads probably aren't in the sequel market). It usually doesn't hurt the seiyuu's career too much if it occurs for good reasons e.g. health, but some impact is inevitable.