Formation of Nanoporous Films during Solid-Phase Reactions