The genes most commonly affected in hereditary breast and ovarian cancer are the BRCA1 and BRCA2 genes. Here, BRCA2 is linked to ovarian carcinoma.