Why does my iphone 4 occasionally get a black screen?

This morning I woke up and texted my friend, but every like 10 seconds my screen goes black as if I turned my phone off. It comes back on almost immediately, but it's still annoying. What's going on? How can I fix this?

Check your battery. Check your carrier. Sometimes one or the other contribute to black out screens, it's rarely the phone.