The static and frequency-dependent first hyperpolarizabilities (beta) of Reichardt's betaine dye and two simplest pyridinium-N-phenoxide betaines were computed in the gas phase and in aqueous solution. The sum-overstate formalism was used to calculate individual components of the beta-tensors. The solvent effect was included via the Langevin dipoles/Monte Carlo approach. The influence of the molecular geometry on the beta values of the betaine dyes was investigated as well. The calculations demonstrate that the beta values strongly depend on the interplanar angle between the pyridinium and the phenoxide ring. Moreover, we observed dramatically decreased values of beta (for all investigated betaines) in aqueous solution as compared to the gas phase.