Using boundary conditions of electromagnetic waves , a new transfer matrix method that study electromagnetic waves in thin films and a dispersive formula of 1D photonic crystal are derived. Using the formula reflection and refraction of light is studied, the forbidden band of 1D photonic crystal is studied. The transfer matrix method and the classic characteristic matrix method are compared. The transfer matrix method can not only solve the problem that characteristic matrix method can solve, the transfer matrix method can also solve the problem that characteristic matrix method can not solve. Therefore the transfer matrix method is a more fundamental and wider range of application.