It's a cute saying that means to handle a bad situation with grace.
"take it on the chin" physically means to be punched on the chin (and usually knocked down) and figuratively means to have something bad or terrible happen (fail a course, lose a job, become very sick, have a death in the family).
"with a grin" figuratively means to remain graceful.