The avalanching of granular material at slope angles between the angle of repose and the angle of maximum stability, such as on a sandpile or on the lee (slip) face of a sand dune, typically produces droplet-shaped flows that consist of a well-defined head at the front. We have performed the first experiments on granular materials using the particle-image velocimetry (PIV) technique, in which we have studied avalanching flows of sand for different surface properties. Our results suggest that the presence of a deformable bed (layer of loose or erodible particles) on the surface is a necessary condition for the occurrence of these flows. We measured for the first time the surface-velocity field in avalanches propagating at angles between the angle of repose and the maximum angle of stability, and observed a transition in the flow behavior with downstream distance, from a surface-like flow to a compressing flow that has the characteristics of a shock wave propagating through the deformable bed. Measurements for sand avalanches seem to indicate that the features of this transition depend on the inclination angle of the surface in the small range between these two critical angles. The results suggest that grainflow laminae and scoria cone flanks, for example, are formed by flows that in their upper part propagate as a surface flow, and in their lower part propagate as a shock wave near the surface of the debris pile.