It is shown that charm photoproduction can be consistently described within an asymptotically free field theory. Quantum chromodynamics is used to derive sum rules for the total cross section σcγ which includes both production of mesons with hidden charm (J/ψ, ψ′ and so on) and of charmed particles (pairs DD, FF and so on). An estimate of σcγ as a function of energy is given and fast growth is discovered up to energies ∼ 1000 GeV. In this energy range σcγ turns out to be equal to several μb. It is argued that measurements of charm photoproduction would give the most direct information on the gluon distribution within a nucleon. All the results are generalized to production of heavier particles containing new quarks. In particular, a simple rescaling law is derived connecting the cross sections for charm and beauty.