Undergraduate research is a high impact educational practice that encourages more women to engage in science. Few studies have focused on gender concordance between mentors and mentees within the context of summer undergraduate research programs, and none have linked gender concordance with student gains. Previous research has more often overlooked the faculty–postgraduate–undergraduate triad, focusing instead on the faculty–undergrad dyad. This study explores the effects of gender concordance among mentoring dyads and triads on student gains from summer research experiences. Using programmatic and evaluation data, bivariate analyses were conducted and generalized estimating equations were employed to examine effects of gender concordance in mentoring relationships on student gains. Results indicate that gender concordance within undergraduate mentee and faculty mentor dyads promoted the greatest student gains among the six categories of mentoring relationships studied, having postgraduate mentors for undergraduates suppressed student gains, and women benefited more than men from gender concordance in mentoring relationships. Considering the results, undergraduate research program staff should make efforts to recruit more women faculty mentors, consider matching them with women undergraduates, train men scientists so they can be effective mentors for women students, and provide high‐quality mentoring training opportunities for postgraduate mentors.