Sorry to bump a semi-old thread, but my iPhone is suddenly having the same problem. I've found if I have my bumper on or squeeze the edge of the glass very lightly the clicking sound goes away.
It's very annoying when I don't have the bumper on. Eventually I'll probably take it to the Apple Store, but since I have the bumper on it really doesn't bother me, at least right now.