In recent years much research has gone in grid computing and building shared resource networks. The grid computing has given access to the research community to high computational resources. The pricing of grid resources has been evolved along with resource management however there is a need for a better pricing model which is well suited for services. In this paper, we first explain the notion of service pricing in the context of shared grid computing. Then, we propose an original development of a mathematical programming model based on Markov decision processes (MDP) in order to maximize grid service level. An example written in AMPL modeling language is provided.