You can use the Auto-Align Layers command to make a composite photo from a pair of nearly identical images that may contain some unwanted areas. For example, one shot of a group portrait is ideal except that one of the subjects has her eyes closed. In another shot her eyes are open. Using Auto-Align Layers and layer masking, you can combine these shots and eliminate the flaw in the final image.
Using the brush tool, add to the layer mask by painting over the top layer. Painting with black completely masks out the top layer, while grayscale creates partial transparency to the layer below, and white restores the top layer. See Masking layers. Continue editing the layer mask until you successfully blend the two layers to create one unified image.
Make sure that the layer mask thumbnail, not the image thumbnail, is selected in the Layers panel during the masking operation.