The incident is causing delays of up to two hours and services are expected to be disrupted until about 8pm tonight.
In a statement, National Rail Enquiries said: "A person has been hit by a train between Doncaster and Retford.
"Whilst emergency services are dealing with the incident, all lines between the stations will be closed.
"As a result of this, trains between Doncaster and Grantham may be delayed by up to 120 minutes or cancelled.
"There is no firm estimate as to when the line will reopen, however, trains on this route are expected to be disrupted until approximately 8pm."