The mask plays a significant role as an active optical element in lithography, for both deep ultraviolet (DUV) and extreme ultraviolet (EUV) lithography. Mask-induced and feature-dependent shifts of the best-focus position and other aberration-like effects were reported both for DUV immersion and for EUV lithography. We employ rigorous computation of light diffraction from lithographic masks in combination with aerial image simulation to study the root causes of these effects and their dependencies from mask and optical system parameters. Special emphasis is put on the comparison of transmission masks for DUV lithography and reflective masks for EUV lithography, respectively. Several strategies to compensate the mask-induced phase effects are discussed.