We consider the transverse-momentum distribution of heavy flavours in photo
n-hadron collisions. We present a formalism in which large transverse-momen
tum logarithms are resummed to the next-to-leading level, and mass effects
are included exactly up to order alpha (em)alpha (2)(s), so as to retain pr
edictivity at both small and large transverse momenta. Phenomenological app
lications relevant to charm photoproduction at HERA are given.