A method of preparation of a medicament for the treatment of lungs having a surfactant insufficiency is disclosed. The method comprises the steps of quantitatively analysing a sample from a patient with regard to at least one of the proteins SP-A, SP-B, SP-C and SP-D, determining if a deficiency of one of the analysed protein SP-A, SP-B, SP-C and SP-D exists and if that is the case, determining a therapeutically effective dose of a replacement substance for the analysed protein SP-A, SP-B, SP-C and SP-D, and preparing a medicament containing the therapeutically effective dose of the replacement substance. A medical device that may be used when carrying out the method is also disclosed. <;IMAGE>;