A numerical model for two-dimensional flow around an airfoil undergoing prescribed heaving motions in a viscous flow is presented. The model is used to examine the flow characteristics and power coefficients of a symmetric airfoil heaving sinusoidally over a range of frequencies and amplitudes. Both periodic and aperiodic solutions are found. Additionally, some flows are asymmetric in that the upstroke is not a mirror image of the downstroke. For a given Strouhal number defined as the product of dimensionless frequency and heave amplitude the maximum efficiency occurs at an intermediate heaving frequency. This is in contrast to ideal flow models, in which efficiency increases monotonically as frequency decreases. In accordance with Wang (2000), the separation of the leading-edge vortices at low heaving frequencies leads to diminished thrust and efficiency. At high frequencies, the efficiency decreases similarly to inviscid theory. Interactions between leading- and trailing-edge vortices are categorized, and the effects of this interaction on efficiency are discussed. Additionally, the efficiency is related to the proximity of the heaving frequency to the frequency of the most spatially unstable mode of the average velocity profile of the wake; the greatest efficiency occurs when the two frequencies are nearly identical. The importance of viscous effects for low-Reynolds-number flapping flight is discussed.