Although the blockchain technology was first introduced through Bitcoin, extending its usage to non-financial applications, such as managing electronic medical records, is an attractive mission for recent research to balance the needs for increasing data privacy and the regular interaction among patients and health providers. Various systems that adopts the blockchain in managing medical records have been proposed. However, there is a need for more work to better characterize, understand and evaluate the employment of blockchain technology in the healthcare industry. In this paper, a design of blockchain based system, namely MedChain, for managing medical records is proposed. MedChain is designed to improve the current systems as it provides interoperable, secure, and effective access for medical records by patients, health care providers, and other third parties, while keeping the patients' privacy. MedChain employs timed-based smart contracts for governing transactions and controlling accesses to electronic medical records. It adopts advanced encryption techniques for providing further security. This work proposes a new incentive mechanism that leverages the degree of health providers regarding their efforts on maintaining medical records and creating new blocks. Extensive experiments are conducted to evaluate the MedChain performance, and results indicate the efficiency of our proposal in handling a large dataset at low latency.