We present a theory for spin-polarized transport in tunnel junctions consisting of a ferromagnet and a semiconductor, in which spin-polarized carriers are created by optical orientation. The model includes, for both spin orientations, the current due to tunneling between the ferromagnet and the semiconductor surface as well as the photoinduced and the thermionic emission currents through the semiconductor subsurface region. Tunneling is described in terms of a spin-dependent tunnel conductance, taking account of the magnetic structure of the ferromagnet. We consider spin depolarization of photoexcited electrons in the semiconductor bulk material and in surface states that have a spin-dependent occupation. The total tunnel current is evaluated as well as current modulations due to modulated spin polarization of photoelectrons (CPM signal) or modulated optical intensity. The calculations show that the CPM signal is proportional to the tunnel conductance polarization and is relatively insensitive to spin depolarization of photoelectrons during their transport to the surface. A severe signal reduction can, however, result from spin relaxation in semiconductor surface states. In addition, it is demonstrated that a crucial role is played by the operating regime of the junction, i.e., photoamperic or photovoltaic, where the selection is determined mainly by the choice of applied bias voltage. We find that the photovoltaic mode is favored, as it yields the highest contribution from spin-polarized tunneling, combined with the smallest sensitivity for unwanted light intensity modulations.