Solar radiation is a key component of the energy budget of snow-covered landscapes. Even a thin snow cover reflects most of the incident sunlight and transmits little. An understanding of the interaction of solar radiation with snow is essential to the study of the snow thermodynamics, chemistry, hydrology, ecology, and remote sensing. To investigate this interaction, a microstructure-based photon-tracking algorithm is presented. The three-dimensional snow microstructure is provided either by a discrete element model defined by shape, size, and spatial arrangement of individual ice grains or by an X-ray microtomography image of a snowpack. The model uses refraction, Fresnel reflection, and absorption laws, and the only optical input parameters are the complex index of refraction and absorption coefficient. The model follows individual photons through the microstructure, a porous network of ice and air, applying the fundamental optics laws at the ice-air interfaces and within the ice. By firing tens of thousands of photons a detailed examination of the spectral radiance and irradiance above, below, and within the snowpack is possible. The model was compared to results from a discrete ordinates model, and its sensitivity to the microstructural representation was studied. It was applied to investigate changes in reflected, absorbed, and transmitted light as a function of wavelength, snow depth, grain size, and snow density, used to predict the amount and direction of scattering within the snowpack, and used to explore the interaction of a collimated beam with snow.