She could have had a stroke or an internal problem. She could also be having problems with the babies in her if she is carrying any. Unfortunately once a fish starts lying on its back and not moving much, there isn't much hope for it.
Try to separate her from the others, perhaps put her in a breeding net or a spare tank if you have one. Otherwise put her in an ice-cream bucket and put it on top of the tank, or in the tank, (but make sure the bucket doesn't tip over and let her back out).