When a man is sexually excited, he gets an erection – his penis becomes bigger, longer and harder. A male can become sexually excited if thinks about sex or sees a good-looking person, or if his penis rubs against something. During puberty, some boys also have spontaneous erections. These are erections that happen by themselves without any reason. This can be embarrassing when it happens in a public place.