We have developed a model for the variability of gamma ray emission in jets of active galactic nuclei in which the variability arises as a result of photon-photon pair production interactions with X-rays emitted by a hot spot in the inner part of the accretion disk . As the hot spot orbits around the central engine , the amount of absorption varies periodically . Our model may account for the observed variability of TeV emission from Markarian 421 and other blazars detected by the EGRET instrument on the Compton Gamma Ray Observatory , as well as correlated variations of X-ray and TeV gamma flux from Markarian 421 . Quasi-periodic variations observed in Markarian 421 enable us to place an upper limit on the black hole mass of ( 2 - 30 ) \times 10 ^ { 8 } M _ { \odot } .