There are several reasons why this could be occuring; ear mites, bacterial infection, respiratory disease.
Ear mites can be treated by putting a couple of drops of olive oil in each ear which will smother the mites, use an eyedropper and apply as needed. Normally the hen would be scratching her ears if they were mites.
Some respiratory diseases that chickens get are bacterial/viral in nature and can cause ear discharge, sometimes with other symptoms such as nasal and eye discharge as well as other symptoms, but not necessarily all the symptoms at once. It could also be a local infection such as from a scratch or peck that got infected somehow in the inner ear or just inside the ear canal.
Wrap your hen snuggly in a towel to prevent her from flapping around and tie her feet together (not too tight) to prevent her from kicking and squirming. Then lay her on one side. Use a Q-tip to gently clean and remove debris, you will most likely have to remove some of the cotton on the tip of the Q-tip so that it will fit inside her ear. You can wet it with water to make it easier to enter the ear canal if you wish. DONT go deep into the ear canal with the Q-tip. Then use an eyedropperful of hydrogen peroxide and flush the ear, it will bubble up which is normal. Then use Q-tips to gently clean and dry the inside of the ear. Next, squeeze neosporin ointment into her ear to the top and leave it. You are done with that ear, flip her over and repeat this procedure with her other ear. Once you're finished with the second ear, release her to go about her business. If it's a bacterial infection, it'll clear up and you wont have to repeat this procedure, especially if it's a local injury. Keep in mind that if it's respiratory...you might have to clear her ears out again in the near future. Good luck.