A simple and effective use of layer masks is to blend two or more images together to create something greater than the sum of its parts.
In this example I'm mixing a Granny Smith and an orange to create a new hybrid fruit. This technique is applicable when combining any similarly shaped but distinctly different objects.
Using the Move tool (v) I dragged the orange image on top of the apple, holding Shift to align the two layers.
Figure 4.18. The source images (examples A and B) and the finished hybrid fruit (example C).
With Free Transform (Edit > Free Transform or Command/Ctrl-T), I distorted the orange so that it was more or less the same shape as the apple and slightly overlapped the edges of the apple. It was helpful to temporarily reduce the opacity of the orange layer to see the apple beneath.
Figure 4.19. Transforming the orange to correspond with the size and shape of the apple.
To retain the shadow of the apple and to make the orange fit exactly into the apple shape, I made a selection of the apple (excluding the shadow) and then, instead of masking the apple itself, targeted the orange layer and added a layer mask to that layer. This is the punch line of this example: you can make a selection on one layer and apply it as a layer mask on another.
To make a transition between the two fruits, I used the Foreground to Transparent gradient on the layer mask of the orange layer. To constrain the gradient to the fruit shape, I turned the mask into an active selection by Command/Ctrl-clicking the layer mask thumbnail.
The gradient transition was a good start, but I found it was also necessary to shape the transition with a large soft-edged brush, painting around the stem area.
To complete the composite, the shadow needed to reflect orange as well as green: I used Quick Mask to make a selection of the shadow on the apple layer and then copied this to a new layer: Layer > New > Layer via Copy or Command/Ctrl-J. I locked the transparency of this layer, then sampled color from the orange with the Eyedropper tool (i), and painted over the shadow. Lastly, I turned the blend mode of the shadow layer to Color and reduced its opacity to about 20%.
Figure 4.20. The Layers palette (example A) and the orange layer mask (example B).