When is it appropriate to address a lady as 先生？
The gender neutral form of the term 先生 is an antiquated Chinese title used for addressing a knowledgeable person who is your senior. This person could be a teacher, a principal, a scholar, a professor or a doctor.

This term, which literally means "born (生) before (先)", has been in use for a very long time. Somebody who is born before you would be your senior, and is deemed to have more experience and knowledge, and therefore should command your respect.

According to 汉典: 


  先生 xiānsheng - 年长有学问的人。《孟子·告子下》：“ 宋牼 将之 楚 ， 孟子 遇於 石丘 ，曰：‘先生将何之？’” 赵岐
  注：“学士年长者，故谓之先生。”《战国策·齐策三》：“ 孟尝君 讌坐，谓三先生曰：‘愿闻先生有以补之闕者。’” 姚宏
  注：“先生，长老，先己以生者也。” 宋 叶适 《宋故孟夫人墓志铭》：“精义择语，类先生长者之法言。”


This means that the term has been around for more than two centuries since the warring states period (475–221 BC).

Today, the gender neutral form of the term 先生 has been replaced by other equivalent titles (老師, 校長, 教授, 博士, 醫生, etc). However, it is still very much in use (pronounced as sensei) in Japan.