Man lights joint in court while facing marijuana charge