The aim of the paper is to introduce a generalization of the Feynman-Kac theorem in Hilbert spaces. Connection between solutions to the abstract stochastic differential equation dX(t) AX(t)dt BdW(t) and solutions to the deterministic partial differential (with derivatives in Hilbert spaces) equation for the probability characteristic Et,xh(X(T)) is proved. Interpretation of objects in the equations is given.