Industrial electricity demand is growing rapidly, whereby, energy consumption modeling and optimization techniques in industries has attracted significant attention in recent years. In this paper, a new model of energy consumption in the production process of aluminum, steel and cement is presented in accordance with a linear piece-wise approximation (LPWA) method. The proposed model is subsequently implemented in the day ahead energy management scheduling of a Microgrid (MG) (involving industrial factories). In order to increase efficiency and give industries an opportunity to contribute in the energy and ancillary services markets, demand response (DR) programs are implemented. The proposed scheduling model considers all the constraints of industrial factories and the MG to maximize their revenue. The performance of the proposed model is evaluated using three case studies. The first and second case studies respectively investigate the effectiveness of the proposed model with and without the implementation of DR programs. In the third case study, the coordination between industrial factories and a MG is investigated. Finally, the results show that the implementation of DR programs and participation of industrial factories in the energy and ancillary services markets, have improved the demand curve, hence increasing the revenue of the MG and industrial factories.