It seems to me like you cat might have tapeworm. What you see is one segment of the tapeworm, which is a specialized muscular egg sac. It can cause both the inflamed rectum and the discharge. As the discharge touches the body, it spreads the eggs, which are eaten by fleas, which the cat ingests to start the cycle all over again.
The only effective and safe tapeworm medications are prescription dewormers available from your local vet. Praziquantal (Droncit Rx) and epsiprantal (Cestex Rx) are the active ingredients that are both safe and effective.
Of course, this is based on just the two things you told me, but since you are going to the local vet anyway, you should take a sample of the discharge and a stool sample if possible.
The only effective and safe tapeworm medications are prescription dewormers available from your local vet. Praziquantal (Droncit Rx) and epsiprantal (Cestex Rx) are the active ingredients that are both safe and effective.
Of course, this is based on just the two things you told me, but since you are going to the local vet anyway, you should take a sample of the discharge and a stool sample if possible.