The formation of the first galaxies is accompanied by large accretion flows and virialization shocks , during which the gas is shock-heated to temperatures of \sim 10 ^ { 4 } K , leading to potentially strong fluxes in the Lyman alpha line . Indeed , a number of Lyman alpha blobs has been detected at high redshift . In this letter , we explore the origin of such Lyman alpha emission using cosmological hydrodynamical simulations that include a detailed model of atomic hydrogen as a multi-level atom and the effects of line trapping with the adaptive mesh refinement code FLASH . We see that baryons fall into the center of a halo through cold streams of gas , giving rise to a Lyman alpha luminosity of at least 10 ^ { 44 } ~ { } erg~ { } s ^ { -1 } at z = 4.7 , similar to observed Lyman alpha blobs . We find that a Lyman alpha flux of 5.0 \times 10 ^ { -17 } erg~ { } cm ^ { -2 } ~ { } s ^ { -1 } emerges from the envelope of the halo rather than its center , where the photons are efficiently trapped . Such emission can be probed in detail with the upcoming James Webb Space Telescope ( JWST ) and will constitute an important probe of gas infall and accretion .