We have developed a cluster model of a TiO(2) nanoparticle in the dye-sensitized solar cell and used first-principles quantum chemistry, coupled with a continuum solvation model, to compute structures and energetics of key electronic and structural intermediates and transition states. Our results suggest the existence of shallow surface trapping states induced by small cations and continuum solvent effect as well as the possibility of the existence of a surface band which is 0.3-0.5 eV below the conduction band edge. The results are in uniformly good agreement with experiment and establish the plausibility of an ambipolar model of electron diffusion in which small cations, such as Li(+), diffuse alongside the current carrying electrons in the device, stabilizing shallowing trapping states, facilitating diffusion from one of these states to another, in a fashion that is essential to the functioning of the cell.