You definitely need to take your child to see his pediatrician
right away! If you can't get in to see his pediatrician right away, then you should go to an emergency room for an immediate evaluation.
I am concerned that this lump in the armpit represents an abscess
or other infection. These can sometimes start off as "swollen glands" like you mention, but a golf-ball sized lump in a 4 yr old is very big! Also the pain is concerning.
In the emergency room or your pediatrician's office, your doctor
can evaluate the lump. If there is a sign of an infection or an abscess, it may be that the lump needs to be opened up so that the pus can be drained out. Also, antibiotics will most likely be necessary to get the infection under control.
There are other less common causes of swollen glands in the armpit that are also serious. For example, this can be caused by lymphoma, a type of cancer. However, given the pain and suddenness of this problem, I think infection is more likely. Regardless, your doctor will be able to evaluate things and make recommendations about what work up and treatments are needed!