it's called flashing and it means that they're being irritated by something. do you know the pH of your water? Nitrite level? Ammonia? It can also happen before an outbreak of Ick.

Do you have a filter set up on your system? Most likely your ammonia or nitrite levels are to high. Do a partial water change.

It's ok for fish to flash every once in awhile, it happens. But if you have a bunch of them doing it then it's probably a sign something is wrong with your tanks water conditions.