Epitaxial MgB 2 films are grown with molecular beam epitaxy (MBE) and optimized with the assistance of in situ reflection high-energy electron diffraction (RHEED). The RHEED patterns clearly revealed the evolution of film structures with growth temperatures and Mg:B ratio, providing the most direct guidance on optimizing growth conditions. A threshold temperature is identified, below which excess Mg will physically condense into the film, and above which excess Mg vaporizes right away leading to a self-limiting growth process for chemically-bound MgB 2 phases. Heteroepitaxial (0001)-MgB 2 /(111)-MgO/(0001)-MgB 2 stacks are deposited and fabricated into micro Josephson junctions, which revealed clear Fraunhofer patterns and Fiske steps, indicating superb materials quality.