The purpose of this article is to present a novel algorithm for the detection of masses in mammographic computer-aided diagnosis systems. Four key points provide the novelty of our approach: (1) the use of eigenanalysis for describing variation in mass shape and size; (2) a Bayesian detection methodology providing a mathematical sound framework, flexible enough to include additional information; (3) the use of a two-dimensional principal components analysis approach to facilitate false positive reduction; and (4) the incorporation of breast density information, a parameter correlated with the performance of most mass detection algorithms and which is not considered in existing approaches. To study the performance of the system two experiments were carried out. The first is related to the ability of the system to detect masses, and thus, free-response receiver operating characteristic analysis was used, showing that the method is able to give high accuracy at a high specificity (80% detection at 1.40 false positives per image). Second, the ability of the system to highlight the pixels belonging to a mass is studied using receiver operating characteristic analysis, resulting in A(z) = 0.89 +/- 0.04. In addition, the robustness of the approach is demonstrated in an experiment where we used the Digital Database for Screening Mammography database for training and the Mammographic Image Analysis Society database for testing the algorithm.