Railways have an important role in the economic development in many countries. They have also undergone organizational transformations since their initial stages, where questions regarding ownership and regulations of production or pricing of goods and services have been at the center of attention. This can explain why rail transport and changes within this industry have early been one of the core subjects of economic analysis and transportation research, where the use of rail cost functions has been powerful. In particular, a rail cost function is a way to characterize the provision of rail transport and is an important tool for analyzing the railway system and its impact on the economy. It can be used to analyze the impact of different forms or conditions for rail transport provision such as effects of (de)regulation, the extent of economies of scale, scope or density, or for analyzing the impact of innovations and investments within this industry. The results can for example serve as input in forming new policies, in appraisal of transport investment, renewal and maintenance, or as means for analyzing the productivity and cost efficiency of rail transport. This paper addresses the specification and use of rail cost functions, how it may vary depending on the issue one wishes to address, and notes some of the challenges and recent developments within this field.