Understanding diffusion of large solutes such as hydrogen and lithium in solids is of paramount importance for energy storage in metal hydrides and advanced batteries. Due to its high gravimetric and volumetric densities, magnesium is a material of great potential for solid-state hydrogen storage. However, the slow hydrogen diffusion kinetics and the deleterious blocking effect in magnesium have hampered its practical applications. Here, we demonstrate fast lateral hydrogen diffusion in quasifree magnesium films without the blocking effect. Massive concomitant lattice expansion leads to the formation of remarkable self-organized finger patterns extending over tens of micrometers. Detailed visualization of diffusion fronts reveals that the fingers in these patterns follow locally the direction of hydrogen diffusion. Thus, the streamlines of the diffusion process are self-recorded by means of the finger pattern. By inclusion of fast hydrogen diffusion objects or local gaps, the resulting streamlines exhibit a clear analogy to optical rays in geometric optics. The possibility to spatially manipulate hydrogen diffusion opens an avenue to build advanced hydrogen storage systems, cloaking and active plasmonic devices, as well as prototype systems for computational models.