Sort:  

Cayenne pepper inhibits production of the acid that causes gastric ulcers so for ulcers it is beneficial. I don't know about other stomach problems though.

Please cite this as a viable treatment only if you have personal experience of gastric ulceration and the effects of cayenne pepper

I wouldn't go so far as to call it a treatment. It's just that the nature of cayenne pepper makes it unlikely to cause or exacerbate ulcers and it has components that may ease symptoms as it counteracts the acid that typically cause them. I'm speaking of consuming it in normal dietary amounts. Too much of anything may have undesired effects.