Lung cancer is the leading cause of cancer deaths worldwide. Early diagnosis of lung nodules is of great importance for therapeutic treatment and saving lives. Automated lung nodule analysis requires both accurate lung nodule benign-malignant classification and attribute score grading. However, this is quite challenging due to the considerable difficulty of nodule heterogeneity modelling and limited discrimination capability on ambiguous cases. To meet these challenges, we propose a Multi-Task deep learning framework with a novel Margin Ranking loss (referred as MTMR-Net) for automated lung nodule analysis. The relatedness between lung nodule classification and attribute score regression is explicitly explored in our multi-task model, which can contribute to the performance gains of both tasks. The results of different tasks can be yielded simultaneously for assisting the radiologists in diagnosis interpretation. Furthermore, a siamese network with a novel margin ranking loss was elaborately designed to enhance the discrimination capability on ambiguous nodule cases. We validated the efficacy of our MTMR-Net on the public benchmark LIDC-IDRI dataset. Extensive experiments demonstrated that our approach achieved competitive classification performance and more accurate attribute scoring over the state-of-the-arts.