You use an opacity mask and a masking object to alter the transparency of the underlying artwork. The opacity mask (also referred to as masked artwork) provides the shape through which other objects show. The masking object defines which areas are transparent and the degree of transparency. You can use any colored object or raster image as the masking object. Illustrator uses the grayscale equivalents of the colors in the masking object for the opacity levels in the mask. Where the opacity mask is white, the artwork is fully visible. Where the opacity mask is black, the artwork is hidden. Shades of gray in the mask result in varying degrees of transparency in the artwork.

When you create the opacity mask, a thumbnail of the masking object appears in the Transparency panel to the right of the thumbnail of the masked artwork. (If these thumbnails aren’t visible, choose Show Thumbnails from the panel menu.) By default, the masked artwork and the masking object are linked (as shown by a link between the thumbnails in the panel). When you move the masked artwork, the masking object moves along with it. However, when you move a masking object, the masked artwork doesn’t move. You can unlink the mask in the Transparency panel to lock the mask in place and move the masked artwork independently of it.

You can move masks between Photoshop and Illustrator. Opacity masks in Illustrator convert to layer masks in Photoshop, and vice versa.
For a video on working with opacity masks, see www.adobe.com/go/vid0056.
Create an opacity mask
Convert an existing object into an opacity mask
Select
at least two objects or groups, and choose Make Opacity Mask from
the Transparency panel menu. The topmost selected object or group
is used as the mask.
Edit a masking objectYou can edit a masking object to change the shape or transparency of the mask.
Unlink or relink an opacity mask
Deactivate or reactivate an opacity maskYou can deactivate a mask to remove the transparency it creates.
Remove an opacity mask
Target the masked artwork in the
Layers panel, and then select Release Opacity Mask from the Transparency
panel menu.
The masking object reappears on top of the objects that were masked.
Clip or invert an opacity mask