We develop an energy-based finite difference method for the wave equation in second order form. The spatial discretization satisfies a summation-by-parts (SBP) property. With boundary conditions and material interface conditions imposed weakly by the simultaneous-approximation-term (SAT) method, we derive energy estimates for the semi-discretization. In addition, error estimates are derived by the normal mode analysis. The energy-based discretization does not use any mesh-dependent parameter, even in the presence of Dirichlet boundary conditions and material interfaces. Furthermore, similar to upwind discontinuous Galerkin methods, numerical dissipation can be added to the discretization through the boundary conditions. We present numerical experiments that verify convergence and robustness of the proposed method.