Composite films of polyaniline (PANI) and single-walled carbon nanotubes have been produced by a simple vacuum filtration process from aqueous solution, and the films have been applied on n-type silicon to form heterojunction solar cells. The performance of devices with the composite electrodes of different constituent ratios and of various film thicknesses has been investigated. It was found that the incorporation of the conducting polymer reduces the sheet resistance of the films, while the overall thickness influences both the conductivity and the amount of light transmitted through to the underlying silicon. By optimizing the composition and thickness of the films, a power conversion efficiency of 7.4% was obtained, which is a 60% increase over that obtained from devices without the polymer. Analysis of the DC electrical to optical conductivity ratios of the various films and comparison of this with the solar cell performance data shows that the improved output is not due solely to better electrical and optical properties but depends strongly on the exact nature of the junction as well, which changes with PANI content.