Trace formulas for pairs of self-adjoint, maximal dissipative and accumulative as well as other types of resolvent comparable operators are obtained. In particular, the existence of a complex-valued spectral shift function for a pair {H , H} of maximal accumulative operators has been proved. We investigate also the existence of a real-valued spectral shift function. Moreover, we treat in detail the case of additive trace class perturbations. Assuming that H and H = H +V are maximal accumulative and V is trace class, we prove the existence of a summable complex-valued spectral shift function. We also obtain trace formulas for pairs {H, H * } assuming only that H and H * are resolvent comparable. In this case the determinant of the characteristic function of H is involved in trace formulas. The results rely on the technique of boundary triplets for densely and non-densely defined closed symmetric operators. The approach allows to express the spectral shift function of a pair of extensions in terms of the abstract Weyl function and the boundary operator. We improve and generalize certain classical results of M.G. Kreȋn for pairs of self-adjoint and dissipative operators, results of A.V. Rybkin for such pairs as well as of