Formation of the Lyman Continuum during Solar Flares