Detection of planetary transits holds great promise for the search of terrestrial planets. However, most stars are variable at the level of the signal produced by the transit of an Earth-like planet. Hence, intrinsic stellar variability can lead to "false" planet transit detections. An understanding of the origin of the stellar variability is needed to ensure reliable transit detections. We consider the Sun as the closest and best studied star and analyze its variability on timescales relevant to the transit effect, namely from an hour to several days. Total and spectral solar irradiance measurements obtained by the VIRGO instrument on board the SOHO spacecraft have been analyzed by applying Fourier and wavelet techniques. Preliminary results suggest that at the time scales of interest solar variability is driven partly by solar magnetic activity, which dominates at longer time scales, and convection, in particular solar granulation, which dominates at shorter time scales. As part of a more quantitative analysis a simple numerical model of the irradiance variations due to granulation has been constructed. Irradiance variability of stars with different surface gravity was calculated in the frequency band of relevance to transits.