Hemorrhoids vs crack
There are several causes of pain in this region, often external hemorrhoids
which are thrombosed (clotted) can cause significant pain.
So is fissure (a crack in the crack), which usually causes intense pain during a bm. If intermittent, brief, shooting pain in rectum could be proctalgia fugax--a difficult to treat medical mistery. I would suggest getting a medical evaluation by your doc. Good luck.