After a soft opening, the stock markets ended marginally lower. The BSE Sensex ended at 31,097 falling 25 points. The 50-share index Nifty was down 6 points to end below 9150.