Thank you for the query.
From your description it does not sound like a cancer. Cancerous tissue is usually very hard, prone to bleed after a touch, does not cause a pain, grows slowly and constantly.
Your lump can be caused by rectal-skin fistula (seems more probable) or it is just a hemorrhoid
Rectal-skin fistula is a pathological connection between skin and rectum
what causes tissues inflammation and leads to an abscess
. Such abscess can get drained by itself (what has most likely happen at your case) so the pain goes away. However as you still have some pus discharge, the fistula is still active.
That is why I suggest you to visit general surgeon
, have rectal examination
and rectosigmoidoscopy (or MRI) done.
Some incision might be necessary.
Hope this will help.