There are a few different causes of pain when sleeping on side, but it is most likely due to the pressure on your ear cartilage. This could be caused by the shape of the ear or by the fact that it is a very friable elastic cartilage which makes it supple and soft, which causes your ear to swell and cause pain when you sleep on it.
The first thing your doctor will want to know is what your symptoms are and if you have been experiencing them for a long period of time. Your healthcare provider will also do a physical exam of your outer and inner ear.
If you have an ear infection, it may be blocking the eustachian tube, or the tubes that connect your middle ear to your outer ear. This can cause the buildup of fluid that can lead to pain, fever and a loss of hearing.
You can try a few simple things to relieve the earache, including placing a cold pack on your outer ear or using a warm compress on the inside of your ear. This will help reduce the swelling that can cause ear pain.
A softer pillow can also help. If you use a soft pillow to sleep on, the pressure from your head against your ear can lessen.
There are some medications that can reduce the pain of an ear infection and help you get a better night's sleep. These include paracetamol and ibuprofen.