This is most commonly related to anal fissures, which are small tears in the muscles in and around the rectum. They can be caused by straining during hard stools, or frequent loose or watery stools. Because they are open wounds, subsequent bowel movements may burn intensely.
Hemorrhoids (either external or internal) can also cause burning.
Also, if the stools move through the intestines too quickly, there may be some bile and/or stomach acid content in the stool, which is acidic and also causes burning sensations during a bowel movment. In this case, the body doesn't have time to absorb and adjust the pH properly. The burning can be anything from a mild pain to a severe rash and even lesions on the skin around the rectum, depending on the amount of acid content and length of exposure on the rectum.
If this is a frequent occurance for you, or you notice blood in the stool, you may want to see a gastroenterologist to determine if there's a problem with the gall bladder, recurrent or severe fissures or hemorrhoids that require further treatment, malabsorption in the intestines, or a functional disorder such as IBS that's causing the problem.
In the meantime, you may want to consider continuing the preparation H, witch hazel, sitz baths, and throughly cleansing the area after each bowel movement to prevent irritation.
I hope this helps!