The 46-year-old woman walked into Sydney's Royal Prince Alfred Hospital and spoke with staff members in the early hours of Thursday morning before striking the man in his head, police alleged.
Initial inquiries suggest the 63-year-old man is known to the woman.
The man remains in a critical condition in an intensive care unit at the hospital.
The woman was taken to Newtown Police Station and charged with causing grievous bodily harm.
Sydney Local Health District chief executive Deb Willcox said the woman interacted with at least one staff member before approaching the man's bedside.
"Shortly after midnight this morning, a visitor coming in to see our patient ... attended the bedside of the patient and an unfortunate and serious event has occurred," Ms Willcox said.
"I'm advised the staff did speak to the person who came into the ward and there was no issue to the best of my knowledge.
"(There) was a conversation had between that person and the staff and they went to the bedside of the patient."
While the hospital had designated visiting hours, Ms Willcox said the buildings were accessible 24 hours a day.
"Our hospital is an open public building where people can gain access anytime of the day or the evening," she said.
"We do whatever we can to enable people and visitors and friends and loved ones to see the patients."
Ms Willcox said the man had been in the hospital for some time and was well-known and liked by staff.
"By all accounts (he's) a really lovely person that the staff are very fond of," she said.
There were several other patients in beds in the same ward at the time of the attack but Ms Willcox said no one else was impacted.
She said the incident would be investigated by the hospital to determine if improvements could be made.
"I also want to acknowledge our staff, who acted very, very swiftly and promptly."
The woman is due to appear at a bail hearing on Thursday.