In general, plants photosynthesize through their leaves and, to a much lesser extent, through their stems. Cacti, however, have no visible leaves, but instead spines. In what part of the cactus does the photosynthesis take place?
In wiki there is a good answer for your question http://en.wikipedia.org/wiki/Cactus#Leaves
In plants photosynthesis takes place in chloroplasts. Chloroplasts may be in the cells of fruits, stems, but most of all in leaves. In some succulents (such as cacti), the main photosynthetic activity is associated with a stem.