It can get pretty hot if you are playing a graphically intense or fast paced game (like Wipeout HD, any of the Uncharted games or God of War III - among others). If it gets hot just staring at the XMB, though, there could be something wrong. If the fan is running, it is doubtful that anything is damaged. If it gets too hot, the PS3 will shut itself down before it overheats.
Try unplugging it and use the hose from a vacuum to clean out any dust buildup from the vents around all sides of your PS3. Also, make sure it has at least 8-10 inches of clearance on all sides, and preferably at least 12-18 inches on the back side (since most of the air is blown out the back).