In this paper a general class of diffusion problem is considered, where the standard time derivative is replaced by a fractional one. For the numerical solution, a mixed method is proposed, which consists of a finite difference scheme through space and a spectral collocation method through time. The spectral method considerably reduces the computational cost with respect to step-by-step methods to discretize the fractional derivative. Some classes of spectral bases are considered, which exhibit different convergence rates and some numerical results based on time diffusion reaction diffusion equations are given