Most of the times physicians prescribe acid suppressing drugs amongst which popular is a group of drugs known as proton pump inhibitors (PPIs). These include omeprazole and rabeprazole etc..
Image via Wikipedia
The PPIs very effectively suppress acid secretion in the stomach and are protective to the damaging effect of NSAIDs to a larger extent. Those prevent gastritis and ulceration in stomach and duodenum.
Now, it has been seen that co-prescription of PPIs with the NSAIDs may spare the stomach and cause damage to the intestine.
Still the use of analgesics is to continue, but a judicious use and no abuse is perhaps the answer. Besides this more research in formulating the drugs may be needed.