We present the simultaneous light and radial velocity curve analysis of two contact binaries in Pegasus using the Wilson-Devinney code. The following absolute astrophysical parameters are determined: masses, radii and effective temperatures. BB Peg is a W-subtype W UMa-type binary, components of which are main sequence stars with 0.50 M⊙ and 1.40 M⊙. The radii of its components are R1 = 0.81 R⊙ and R2 = 1.28 R⊙. V407 Peg is an A-subtype contact binary composed of two subgiant components with masses 1.70 M⊙ and 0.43 M⊙, and radii R1 = 2.17 R⊙ and R2 = 1.25 R⊙. Comparisons with the theoretical models for solar composition by Girardi et al. (2000) confirms our classification and supports the results.