The woman, who has not been identified, said she told him to stop. He continued the lewd act and eventually followed her to the front door of her house after she went inside, police said.
The woman said she yelled through the door for the man to leave and warned him she had a gun. He did not, so she shot him in the chest through the door, police said.
The man got back on his bike, started riding and collapsed nearby, KPRC reported.
The man was taken to a hospital in critical condition. He is expected to survive, the Chronicle reported.
Investigators are still determining if the woman will be charged.
The woman's 14-year-old granddaughter was in the house but was not aware of the commotion, the Chronicle reported.
Police said they recognized the man, who was on bond for an exposure charge from a week earlier when he was found walking along a busy street naked.