To empathize is to understand or relate to someone else's emotional experience. If you get teary-eyed upon hearing about the death of your friend's pet hermit crab, you're probably empathizing with your friend — unless you're just bored to tears by her story.
Empathize is often used interchangeably with sympathize, but you'll get no empathy (or sympathy) from usage experts if you confuse the two. When you sympathize with another person, you feel sad that she is suffering, but you don't necessarily relate to her experience. It's easiest to empathize when you've been through a similar experience; for example, if your pet guppy had recently passed away, your friend's hermit crab story would have broken your heart due to empathy.