J-spectral factorization for general discrete rational matrices is considered in this paper. We propose a simple approach based on the Kalman filtering in Krein space. The main idea is to construct a stochastic state space filtering model in Krein space such that the spectral matrix of the output is equal to the rational matrix to be factorized. The spectral factor is then easily derived by using the generalized Kalman filtering in Krein space, which is similar to the H-2 spectral factorization. Our approach unifies the treatment of the H-2 spectral factorization and the J-spectral factrization. The applications of the derived results in H-infinity and risk-sensitive estimation for both nonsingular and singular systems are demonstrated.