  Let X be a smooth projective curve over an algebraically closed field of
characteristic >2. Consider the dual pair H=SO_{2m}, G=Sp_{2n} over X with H
split. Write Bun_G and Bun_H for the stacks of G-torsors and H-torsors on X.
The theta-kernel on Bun_G\times Bun_H yields the theta-lifting functors between
the derived categories of l-adic sheaves on Bun_G and Bun_H. We describe the
relation of these functors with Hecke operators.
  In two particular cases it becomes the geometric Langlands functoriality for
this pair (in the nonramified case). Namely, for n=m the functor from the
derived category on Bun_H to that on Bun_G commutes with Hecke functors with
respect to the inclusion of the Langlands dual groups SO_{2n}\to SO_{2n+1}. For
m=n+1 the functor from the derived category on Bun_G to that on Bun_H commutes
with Hecke functors with respect to the inclusion of the Langlands dual groups
SO_{2n+1}\to \SO_{2n+2}.
  In other cases the relation is more complicated and involves the SL_2 of
Arthur. As a step of the proof, we establish the geometric theta-lifting for
the dual pair GL_m, GL_n. Our global results are derived from the corresponding
local ones, which provide a geometric analog of a theorem of Rallis.
