This is a perforated ear drum, your son has has an ear infection for the last fewday which is very painful, however the ear drum has now burst which relieves the pressure and causes the pain to recede, hence the sleeping! Repeated ear infections can cause hearing problems and may need grommets, but the odd one or two only need antibiotics, and even then not always. My son suffers badly with this so it is very familiar to me. I'd take him to the doctor today as they may want to take a swab of the gunk to see which antibiotics it responds to or if they are needed.
With my children it really isn't a sign of a burst ear drum - ds1 and ds2 have both had periods of MONTHS where thick black/brown wax-like gunk oozes out - it's really grim, but I have been told by SO many medics it's fine, including at an audiology clinic - they said it was just the ear cleaning itself.
if it is a burst ear drum he might be more likely to pick up an infection right now (i.e. bacterial), so I would have the GP check it and then try to avoid obvious places where he might pick up an infection such as soft play areas/swimming pools. It could be that he will be given anti-biotics, so I would see a doctor.
Burst eardrum - Follow advice to talk to GP although the worst of the pain's now over (for one ear) and also ask advice on when he can go swimming if he normally goes. Not a great time for it to happen. I sympathise as my daughter was the same at that age.
it sounds like a perforated ear drum to me although a GP can check it very easily as some kids do get excess ear wax although I have mistaken my son's ear ache for teething pain and don't realise until the drum is perforated and gunk is coming from it. If it is a one off then a bottle of antibiotics (or better still Gentisone drops ... which you can only get from ENT specialists) would be fine if Ben has a temperature. Don't forget to give probiotics when administering oral antibiotics.
My son's ear drums were bursting every month and he had a ridiculous amount of antibiotics and I took him to private and NHS ENT consultants and no-one suggested taking him off dairy. My French sister in law told me to give my son goats milk and I was very skeptical and my GPs thought I was nuts but I gave it a go and now I have a totally changed boy. I want to shout out the massive benefits of goats milk to all parents with kids who suffer from repeated ear infections. It even sorted out his digestion as he was pooing 7-8 times a day and always had a horribly sore bum. PLEASE try it if your kids are getting repeated ear infections (and yoghurt and cheese). I wish I had known about it beforehand as I didn't give it to my son until he was 2 and he was always so moany and in pain and I was just told that I had a "needy baby". He used to wake up screaming several times a night until 2-3 weeks after taking him off dairy and now he sleeps heaps better and people are amazed at the change in him. Apparently the benefits of goats milk are recognised in France and Germany but the UK is a bit behind on that front which is a great shame as it might have avoided my son's adenoidetomy and grommits (which fell out soon afterwards).