A lapel microphone is attached directly to the subject being recorded (hidden from the view of the camera). This microphone enables the capture of a very personal and close sound that can give an effect of personal space invasion or dominance.
Gun microphones are aimed at the subject being recorded and can be very effective in eliminating background noise or focusing on one sound among a slew of others. The effect of these microphones is to create a sound cone from behind the camera to focus on one source.
A boom microphone is held over the head of the subject(s), and can be turned to create an even more focused and clean sound recording than the gun microphone. The boom microphone is the most common type of microphone used in film and TV.
Filmmakers almost always record sound to an external device rather than the actual camera. A high quality digital sound recorder is used to record all of the sound captured by the various microphones. This recording can later be synced with the video.
One of the final steps in the production of sound for movies is the cleaning and editing of rough sound taken from the digital recording. Major film companies use the finest software available to add greater flexibility and quality to their film sound recordings.