Why does my iPhone stay black when it rings?

About every other time someone calls me, the screen will stay black and won't let me answer it. Why does this keep happening and how do I fix it? Thanks!
 
Top