I have stomach pain and gas trouble at nights and little bit lose motion also?

Stress? Food journal. Has this ben going on for awhile or is it more recent?Is it every night? Could you keep a food/drink journal to track everything you're ingesting to see if any of those are triggers,especially if you tend to drink alcohol at night.Also,frequent stress can cause similar symptoms,so could consider counseling to help redirect stress to not affect your GI system.May also need CT, EGD, or colonoscopy.
Spasm. you might have a condition called irritable bowel syndrome usually triggered by stress specific food could caused it as well avoid or minimize stress avoid red meat avoid raw vegetables avoid dairy products regulate your bowels and take gas X THERE FOOD THAT YOU LIKE BUT IT MIGHT NOT LIKE YOU BACK STAY AWAY FROM IT.
Need history. Very loaded question, with a long list of causes. Food intolerance, mild gastroenteritis, malabsorption, Irritable bowel syndrome, lactose intolerance, celiac disease are a few of many in the list. Now all these are not true for you...just a list to go over and call your doctor.
Lose Motion? Can you please clarify what you mean by "lose motion"? You were talking about gastrointestinal symptoms, so I wonder if you are talking about loose bowel movements or diarrhea, but I am not sure. Please clarify and I'd be happy to help you.