Ear infections are very common, especially in younger children.
It often occurs when a cold blocks the tube that drains fluid from the middle ear into the back of the nose and throat. The pain is due to increased pressure on the eardrum from the trapped fluid and pus. The pain may be worse when the child is lying down or sucking on a bottle. Give it as directed, until it is gone. Make sure you give all the medicine, or the infection might come back.