The Apocolypse is not read as an entirely literal book, but one that depicts events in a symbolic manner. The symbolism of the Four Horsemen, or Angels spilling out blood etc, are written to signify spiritual battles that occur, not just in a literal end time, but also in our own spiritual lives. So the pains of the woman giving birth, can be read as the pain of sin that made the need for our salvation to occur.
There is a saying in Latin, “Oh Felix Culpa” Oh Happy Fault. It speaks of how while sin is horrible, that it did after all result in God showing us how much he loves us by becoming incarnate and offering the perfect sacrifice for us. That God can transform us from sinful to just.
(on another note, linking to my posting on translation. You could “Literally” translate Oh Felix Culpa, Oh Sin of Cat, as Culpa can be translated fault, or sin, and felix is cat or happy. So it points out that one has to understand the context and history of what you are reading or translating.)