Nanostructured materials have attracted much attention for enhancing the performance of solar cells due to their unique advantage of high light absorption. In this regard, here we propose a CdS/Si nanoheterojunction array, called CdS/Si-NPA, for harvesting the energy of sunlight. CdS/Si-NPA was obtained by depositing a continuous film of CdS onto silicon nanoporous pillar array (Si-NPA) via a chemical bath deposition (CBD) method and the average reflectance of CdS/Si-NPA was less than 7% in the wavelength range of 200–1000 nm. Under 1 sun air mass (AM) 1.5 G illumination, CdS/Si-NPA exhibits an obvious photovoltaic effect. These results indicate that CdS/Si-NPA has a strong broadband optical antireflection and might be a promising candidate for the assembly of high efficiency solar cells.