In most cases, snapping is caused by the movement of a muscle or tendon over a bony structure in the hip.
The most common site is on the outside of the hip where a band of connective tissue known as the iliotibial band passes over part of the thigh bone that juts out -- called the greater trochanter. When you stand up straight, the band is behind the trochanter. When you bend your hip, however, the band moves over and in front of the trochanter. This may cause the snapping noise.
Another site of snapping is where the ball at the top of the thigh bone fits into the socket in the pelvis to form the hip joint. The snapping occurs when the rectus femoris tendon, which runs from inside the thighbone up through the pelvis, moves back and forth across the ball when the hip is bent and straightened.