We report a mechanism of nonisothermal dendritic flux penetration in superconducting films. Our numerical and analytical analysis of coupled nonlinear Maxwell and thermal diffusion equations shows that dendritic flux pattern formation results from spontaneous branching of propagating flux filaments due to nonlocal magnetic flux diffusion and positive feedback between flux motion and Joule heating. The branching is triggered by a thermomagnetic edge instability, which causes stratification of the critical state. The resulting distribution of thermomagnetic microavalanches is not universal, because it depends on a spatial distribution of defects. Our results are in good agreement with experiments on Nb films. © 2005 The American Physical Society.