Actually, most of the electric energy is being produced by fossil fuels and great is the search for viable alternatives. The most appealing and promising technology is photovoltaics. It will become truly mainstream when its cost will be comparable to other energy sources. One way is to significantly enhance device efficiencies, for example by increasing the number of band gaps in multijunction solar cells or by favoring charge separation in the devices. This can be done by using cells based on nanostructured semiconductors. In this paper, we will present ab-initio results of the structural, electronic and optical properties of (1) silicon and germanium nanoparticles embedded in wide band gap materials and (2) mixed silicon-germanium nanowires. We show that theory can help in understanding the microscopic processes important for devices performances. In particular, we calculated for embedded Si and Ge nanoparticles the dependence of the absorption threshold on size and oxidation, the role of crystallinity and, in some cases, the recombination rates, and we demonstrated that in the case of mixed nanowires, those with a clear interface between Si and Ge show not only a reduced quantum confinement effect but display also a natural geometrical separation between electron and hole.