We have developed techniques to determine the near-infrared to near-ultraviolet dielectric function and optical gap of ultrathin amorphous silicon [a-Si:(H)] using real-time spectroscopic ellipsometry during preparation and processing. The techniques have been applied to approximately 50 angstrom a-Si:H films prepared by plasma-enhanced chemical vapor deposition, and to approximately 250 angstrom pure a-Si chemically modified by atomic H exposure. For the latter, the time evolution of the bonded H content can be estimated along with the evolution of the gap.