There is a condition like what you described called snapping triceps syndrome (STS). It is seen most often in men who lift weights or do pushups.
When the elbow is fully bent (flexed) or extended straight after being fully flexed, the medial tendon of the triceps muscle along the inside of the elbow dislocates. It moves out of the groove where it is normally located, and snaps over the bone along the inside of the elbow.
The condition is diagnosed based on the symptoms and confirmed with an MRI. Images of the elbow are taken when it is bent and while it straightens into extension. Realtime ultrasound can also be used to show the snapping structures.
What is actually causing the dislocation remains unknown. At first it was thought that the muscle firing pattern was abnormal. But studies have not been able to show a difference in muscle activation patterns between patients with STS and normal, healthy adults with no elbow symptoms.
Since the problem occcurs most often in weight lifters and men who perform pushups, there may be a connection between the size and bulk of the muscle and this snapping dislocation that occurs with elbow movement. Further studies are needed to prove or disprove this theory before we will know what to do about the problem.