Basis problems for self-adjoint matrix valued functions are studied. We suggest a new and nonstandard method to solve basis problems both in finite and infinite dimensional spaces. Although many results in this paper are given for operator functions in infinite dimensional Hilbert spaces, but to demonstrate practicability of this method and to present a full solution of basis problems, in this paper we often restrict ourselves to matrix valued functions which generate Rayleigh systems on the n-dimensional complex space C-n. The suggested method is an improvement of an approach given recently in our paper [M. Hasanov, A class of nonlinear equations in Hilbert space and its applications to completeness problems, J. Math. Anal. Appl. 328 (2007) 1487-1494], which is based on the extension of the resolvent of a self-adjoint operator function to isolated eigenvalues and the properties of quadratic forms of the extended resolvent. This approach is especially useful for nonanalytic and nonsmooth operator functions when a suitable factorization formula fails to exist. (C) 2007 Elsevier Inc. All rights reserved.